当我直接在powershell终端中运行以下代码行时,它可以很好地工作: dotnet build ./MySolution.sln --configuration Release 但是,当我将这一行放在powershell脚本中,并从同一目录中运行它时,我得到了这个错误: MSBUILD : error MSB1009: Project file does not exist. 我尝试以不同的方式传递参数,就像How to invoke MSBuild from PowerShell using & operator?中的一个答案中提到的那样,所以我现在很困惑。我需要做什么才能在p
我的天蓝色管道yaml运行一个powershell脚本,该脚本存储在回购程序中。
powershell脚本需要3个变量:工作目录、Oauth访问令牌和源分支名称(触发管道)。
但是,似乎每当我试图传递参数时,powershell脚本都不会识别它们,并得到一个错误。
The term 'env:SYSTEM_ACCESSTOKEN' is not recognized as the
name of a cmdlet, function, script file, or operable program
The term 'env:BUILD_SOURCEBRANCHN
我必须从批处理文件中调用PowerShell脚本。脚本的其中一个参数是布尔值:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -File .\RunScript.ps1 -Turn 1 -Unify $false
命令失败,并显示以下错误:
Cannot process argument transformation on parameter 'Unify'. Cannot convert value "System.String" to type "System
我正在使用powershell函数打开一个新的终端窗口。我希望能够在这个窗口中运行一个可以访问函数参数的脚本。但是在start powershell块中,函数的参数是不可用的:
function startChalk([string] $thing) {
echo "thing is $thing" # this works - here we have access to $thing
start powershell {
echo "now it's $thing" # this fails - here we have no ac
我有一个带有提示文本参数的TeamCity构建,并将它传递到powershell脚本中(通过使用PowerShell运行程序、脚本文件和执行模式“从外部文件执行.ps1”)。脚本参数如下所示:
-MyParameter1 "%myparameter1%"
-MyParameter2 "%myparameter2%"
生成启动用户可以输入多行参数。例子如下:
multiline test
second line
3rd line
在这种情况下,我得到了一个错误:
无法找到接受参数“测试第二行第3行”的位置参数。
在TeamCity日志中,我看到了下一个命令