运行 这个 PowerShell 脚本在哪个文件夹中?

In which folder to run this PowerShell script?

我正在关注example。它正在将 ASP.NET 应用程序发布到远程 Linux 服务器上的 docker 容器。

运行脚本有一小部分工作。 引用一下吧。

Also be sure to explore the PublishProfiles folder that gets created in your Visual Studio project under "Properties." A PowerShell script and a Shell script get created in that folder that you can use to publish your app from the command line. For example:

.\hanseldocker-Docker-publish.ps1 -packOutput $env:USERPROFILE\AppData\Local\Temp\PublishTemp -pubxmlFile .\hanseldocker-Docker.pubxml

我不确定 .\ 的位置。实际上我正在使用 Bamboo 来构建它,我必须将脚本放入正文中。

.

因为.\不知道是否应该修改脚本?

here.

获取解决方案

使用常规的旧命令行启动它,并将任何 powershell 脚本作为参数传递。

C:\Windows\System32\cmd.exe /c "echo Hesus | C:\WINDOWS\SysWOW64\WindowsPowerShell\v1.0\powershell.exe %*"

将其放入参数中:

scripts\RemoteWSPDeployment.ps1 –parameter1 value1 –parameter2 value2