PowerShell
- how to run script
[https://www.windowscentral.com/how-create-and-run-your-first-powershell-script-file-windows-10]
Set-ExecutionPolicy Restricted -- changed :A
若要了解计算机上的现用执行策略,请键入:
get-executionpolicy
若要在本地计算机上运行您编写的未签名脚本和来自其他用户的签名脚本,请使用以下命令将计算机上的
执行策略更改为 RemoteSigned:
set-executionpolicy remotesigned
- how to exe shell script
[https://cloud.tencent.com/developer/ask/60300]
一般来说,你调用一个本地命令,其路径中有一个空格,如下所示:
& "c:\some path with spaces\foo.exe" <arguments go here>
这是&后面跟着一个字符串,标识一个命令:cmdlet,函数,本机EXE相对或绝对路径。
一旦你得到这个:
& "c:\some path with spaces\foo.exe"
根据需要引用参数
-- RemoteSigned: Requires that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher. 在PowerShell执行以下: PS C:\Windows\system32> set-ExecutionPolicy RemoteSigned