问题
在Windows下自动化,写了输出日志的公共模块,需要在所以脚本执行前执行。就像Linux的.bashrc,.profile,启动shell之前都会执行。
Path for PowerShell profile
# c:/users/your_user_name/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
在新的脚本里面调用
.$profile
# your code below
本文介绍如何在Windows环境下设置自动化脚本的公共模块,类似于Linux的.bashrc或.profile文件,确保每次启动PowerShell时都能自动加载指定的日志记录模块。
在Windows下自动化,写了输出日志的公共模块,需要在所以脚本执行前执行。就像Linux的.bashrc,.profile,启动shell之前都会执行。
# c:/users/your_user_name/Documents/WindowsPowerShell/Microsoft.PowerShell_profile.ps1
.$profile
# your code below
转载于:https://my.oschina.net/fqzhang/blog/1810723
2047

被折叠的 条评论
为什么被折叠?