ExecutionPolicy
因为机器设置为
AllSigned
.
PS> Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
目前我的简介中没有太多内容,但随着新任务的出现,我希望能够像这样向其中添加函数:
## Auth stuff
#Import-Module $env:USERPROFILE\Documents\WindowsPowerShell\storecredz.psm1
# NOTE: This sets the ExecutionPolicy to Bypass for the current powershell window...
# `Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process`
function initAssets($blah) {
$Host.UI.RawUI.WindowTitle = "Assets - New Beta"
Import-Module $env:USERPROFILE\Documents\WindowsPowerShell\psm\assets\init.psm1
}
上面是我的powershell配置文件中的内容…并且在设置
对于PS窗口,我运行
.\Microsoft.PowerShell_profile.ps1
我以为它会把我的
initAssets
功能…但不是。
当我按tab键来完成功能时,它可能不会向上拉这个键,有什么特别的原因吗?配置文件运行时没有错误…我在新的Powershell窗口中尝试过它。