【发布时间】:2021-11-03 19:12:22
【问题描述】:
我喜欢从我的管道脚本中解耦函数并编写一个模块。到目前为止一切顺利。
现在我需要在运行时从当前分支(不是主分支)导入该模块。
Import-Module -Name "$($ENV:AGENT_RELEASEDIRECTORY)\$($ENV:RELEASE_PRIMARYARTIFACTSOURCEALIAS)\scripts\MyModule.psm1" -Force
输出
2021-09-06T18:07:41.8185223Z VERBOSE: Loading module from path 'D:\a\r1\a\_acr\scripts\MyModule.psm1'.
2021-09-06T18:07:42.0458821Z ##[error]Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available.
2021-09-06T18:07:42.1872487Z ##[error]PowerShell exited with code '1'.
有什么想法吗?
【问题讨论】: