Windows PowerShell与.NET框架的深入探索
1. PowerShell脚本签名与远程执行
在使用PowerShell时,脚本签名和远程执行是重要的功能。以下是脚本签名的详细步骤:
1. 点击“Install Certificate”按钮。
2. 在“Welcome to the Certificate Import Wizard”屏幕中,选择“Local Machine”,然后点击“Next”。
3. 在“Certificate Store”屏幕中,选择“Place All Certificates in the Following Store”,接着点击“Browse”。
4. 选择“Trusted Publishers”,点击“OK”,再点击“Next”。
5. 在“Completing the Certificate Import Wizard”屏幕中,点击“Finish”,此时会弹出“导入成功”的提示框。
6. 点击“OK”。
完成证书导入后,就可以对脚本进行签名。例如,对之前创建的简单Do While脚本进行签名,可使用以下命令:
Set-AuthenticodeSignature c:\DoWhile.ps1 @(Get-ChildItem cert:\CurrentUser\My -codesign)[0]
此命令使用个人存储中的证书对脚本进行签名。签名后,脚本可以顺利运行,不会出现提示信息。
PowerShell远程执行依赖于Windows Remote Man
超级会员免费看
订阅专栏 解锁全文
35

被折叠的 条评论
为什么被折叠?



