39 Star 222 Fork 51

chuanjiao10 / kasini3000

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sxa刷新所有被控机对象的_os类型属性.ps1 1.86 KB
一键复制 编辑 原始数据 按行查看 历史
#建议保存编码为:bom头 + utf8
if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{
& 'c:\ProgramData\kasini3000\0k_source.ps1'
}
if ($IsLinux -eq $True)
{
& '/etc/kasini3000/0k_source.ps1'
}
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Host -ForegroundColor Green "【$PSCommandPath】正在运行"
}
else
{
Write-Host -ForegroundColor green "【$PSCommandPath】running..."
}
Write-Warning 'wait...'
if ($PSVersionTable.psversion.major -ge 7)
{
$ErrorView = 'NormalView'
& 'sxa刷新所有被控机对象的_os类型属性psv7.ps1'
}
else
{
foreach ($private:当前被控机2 in $global:所有被控机)
{
& 'sx1刷新单个被控机对象的_os类型属性.ps1' -被控机ip地址 $private:当前被控机2.ip
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Host "ip:" -ForegroundColor Cyan -NoNewline
Write-Host $private:当前被控机2.ip -ForegroundColor Yellow -NoNewline
Write-Host " 被控机名:" -ForegroundColor Cyan -NoNewline
Write-Host $private:当前被控机2.被控机显示名 -ForegroundColor Yellow -NoNewline
Write-Host " 被控机os:" -ForegroundColor Cyan -NoNewline
Write-Host $private:当前被控机2.被控机os类型 -ForegroundColor Yellow
}
else
{
Write-Host "ip:" -ForegroundColor Cyan -NoNewline
Write-Host $private:当前被控机2.ip -ForegroundColor Yellow -NoNewline
Write-Host " name:" -ForegroundColor Cyan -NoNewline
Write-Host $private:当前被控机2.被控机显示名 -ForegroundColor Yellow -NoNewline
Write-Host " os:" -ForegroundColor Cyan -NoNewline
Write-Host $private:当前被控机2.被控机os类型 -ForegroundColor Yellow
}
}
}
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Warning '已完成刷新,所有被控机的【端口】、【操作系统】、【发行版类型】等项目。'
}
else
{
Write-Warning 'NODELIST file,refresh complete.'
}
exit 0
PowerShell
1
https://gitee.com/chuanjiao10/kasini3000.git
git@gitee.com:chuanjiao10/kasini3000.git
chuanjiao10
kasini3000
kasini3000
master

搜索帮助