手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

Powershell将当前日期赋值给变量的方法

时间:2024-10-11 22:58:45

1、打开Windows Powershell程序窗口;

Powershell将当前日期赋值给变量的方法

2、在Powershell中可以使用 get-date 查询当前日期,至于赋值变量也是很简单的;我们先看一下 get-date 指令的功能;

Powershell将当前日期赋值给变量的方法

3、假设我们将当前日志赋值给 demo ;首先需要输入 $demo ;

Powershell将当前日期赋值给变量的方法

4、接着输入等号和get-date,如下图;

Powershell将当前日期赋值给变量的方法

5、点击回车自动完成赋值;

Powershell将当前日期赋值给变量的方法

6、直接运行 $demo 指令,即可查看赋值结果。

Powershell将当前日期赋值给变量的方法
© 手抄报圈