1 Star 0 Fork 54

miwangniao/project_12932352

forked from chuanjiao10/kasini3000 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
bkj_install_k记饭店_win被控机.ps1 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
chuanjiao10 提交于 2020-10-05 13:44 . 英文化2
#建议保存编码为:bom头 + utf8
# 启用winrm,安装插件。非必要安装ps6,或ps7。
#Requires -RunAsAdministrator
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Error '信息:此脚本只能在被控机上运行。'
}
else
{
Write-Error 'note:Information: This script can only be run on NODE'
}
if (($PSVersionTable.PSVersion.Major -lt 5) -and ($PSVersionTable.PSVersion.Minor -lt 1))
{
Write-Error '错误:powershell版本太低。必须是powershell5.1'
Exit 11
}
if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{
$win7 = powershell.exe -command { (Get-WmiObject -Class Win32_OperatingSystem).Caption -like "*7*" }
$win2008 = powershell.exe -command { (Get-WmiObject -Class Win32_OperatingSystem).Caption -like "*2008*" }
if ( $win7 -or $win2008 )
{
Write-Warning '卡死你3000被控机,支持win7,支持win2008。'
}
#设定winrm
Enable-PSRemoting -SkipNetworkProfileCheck -Force
Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-NoScope" -RemoteAddress Any
Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP" -RemoteAddress Any
Restart-Service WinRM #并重启服务
}
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PowerShell
1
https://gitee.com/miwangniao/kasini3000.git
[email protected]:miwangniao/kasini3000.git
miwangniao
kasini3000
project_12932352
master

搜索帮助