PowerShell 初始化环境 用于批量部署

Posted CIAS

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PowerShell 初始化环境 用于批量部署相关的知识,希望对你有一定的参考价值。

  • 查看网路状态

Get-NetConnectionProfile

设置成【专用网络】需要InterfaceIndex 编号

set-netconnectionprofile -InterfaceIndex 4 -NetworkCategory Private

设置成【公用网络】需要InterfaceIndex 编号

set-netconnectionprofile -InterfaceIndex 4 -NetworkCategory Public

允许运行脚本

允许单个命令,但不允许脚本,阻止运行 .ps1xml .psm1 所有脚本文件 Restricted
允许所有脚本 Unrestricted
允许本地脚本和远程签名的脚本 RemoteSigned
仅允许签名脚本 AllSigned
set-executionpolicy remotesigned -Confirm:$false -Force

启动 winRM serv

以上是关于PowerShell 初始化环境 用于批量部署的主要内容,如果未能解决你的问题,请参考以下文章

PowerShell批量部署Hyper-V Windows虚机

在世纪互联版的Microsoft Azure上做windows虚拟机的批量部署--用powershell做部署

PowerShell 批量部署windows_exporter到所有Windows主机

PowerShell 批量部署windows_exporter到所有Windows主机

PowerShell 批量部署VMware-tools到所有Windows主机

PowerShell 批量部署VMware-tools到所有Windows主机