我想从Windows命令提示符启动.ps1。我的Powershell脚本有一个path参数。下面是我在MyPowerShell.ps1中启动.ps1测试的命令行,如果我写主机路径,我会得到:C:\ powershell Set-ExecutionPolicy Unrestricted -scope process ; C:\\MyPowerShell.ps1 -Path \"C:\\Test for my script\test1.txt"。当第一个空格出现时,它会切断我的字符串。怎样才能获得完整的路径?谢谢。
如何将值与参数一起传递?类似于。/test.ps1 -controllers 01。我希望脚本使用hyphen,同时传递参数的值。
这是我写的脚本的一部分。但是如果我用hyphen (.\test.ps1 -Controllers)调用脚本,它会显示A parameter cannot be found that matches parameter name 'Controllers'.
param(
# [Parameter(Mandatory=$false, Position=0)]
[ValidateSet('Controllers',
下面是我的node.js项目的文件夹结构:
MySampleApp\
MySampleApp\Package.json
MySampleApp\Server.js
MySampleApp\public:
index.html - Invoked when server.js starts and shows "Click Me" button
fetchprocess.js - check button click and then show in DocumentElementID
user1.ps1 - runs Get-Process comman