可怕的一天与TeamCity和PowerShell结束
NamedParameterNotFound
Get-ChildItem : A parameter cannot be found that matches parameter name 'File'.
$files = Get-ChildItem -Path $RootFolderPath -Filter $CodeFilename -File -Recurse违规行(上、下)位于由PS1运行的TeamCity中。
脚本在我的本地开发机器上运行得很好,TC服务器上的PS版本显然是4.0,我可以在TC服务器本身的PS命令窗口中看到-File参数。
-File参数怎么会从Get-ChildItem中丢失呢??
发布于 2015-11-26 18:17:33
在TeamCity中的“脚本参数”框中,我
改变了这个
-RootFolderPath '%teamcity.build.checkoutDir%' -VersionString '%AssemblyVersionStringWithCounter%'到这个
-RootFolderPath %teamcity.build.checkoutDir% -VersionString %AssemblyVersionStringWithCounter%而且它是有效的。天知道。
https://stackoverflow.com/questions/33944858
复制相似问题