39 Star 222 Fork 51

chuanjiao10 / kasini3000

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
lsnode.ps1 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
chuanjiao10 提交于 2023-05-21 12:17 . 新增:krun-threadjob.ps1
#建议保存编码为:bom头 + utf8
if ($env:LANG -eq 'zh_CN.UTF-8')
{
$private:a = @{Expression = { $_.'ip' };Label = 'ip' ;width = 28 },
#@{Expression = { $_.'端口' };Label = '端口' ;width = 5 },
@{Expression = { $_.'被控机os类型' };Label = '被控机os类型' ;width = 18 },
@{Expression = { $_.'被控机显示名' };Label = '被控机显示名' ;width = 26 },
@{Expression = { $_.'被控机分组名' };Label = '被控机分组名' ;width = 12 }
#@{Expression = { $_.被控机uuid };width = 15 }
}
else
{
$private:a = @{Expression = { $_.'ip' };Label = 'ip' ;width = 28 },
#@{Expression = { $_.'端口' };Label = '端口' ;width = 5 },
@{Expression = { $_.'被控机os类型' };Label = 'OSTYPE' ;width = 18 },
@{Expression = { $_.'被控机显示名' };Label = 'NODE NAME' ;width = 26 },
@{Expression = { $_.'被控机分组名' };Label = 'NODE GROUP' ;width = 12 }
#@{Expression = { $_.被控机uuid };width = 15 }
}
if ($IsLinux -eq $True)
{
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Host -ForegroundColor green '被控机列表文件存储位置:【/root/kasini3000/nodelist.csv】'
}
else
{
Write-Host -ForegroundColor green 'nodelist file at【/root/kasini3000/nodelist.csv】'
}
}
if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Host -ForegroundColor green '被控机列表文件存储位置:【~\Documents\kasini3000\nodelist.csv】'
}
else
{
Write-Host -ForegroundColor green 'nodelist file at【~\Documents\kasini3000\nodelist.csv】'
}
}
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Host -ForegroundColor green '====================【所有被控机列表】===================='
}
else
{
Write-Host -ForegroundColor green '====================【ALL NODE】===================='
}
$global:所有被控机 | Sort-Object -Property ip | Format-Table $private:a
exit 0
PowerShell
1
https://gitee.com/chuanjiao10/kasini3000.git
git@gitee.com:chuanjiao10/kasini3000.git
chuanjiao10
kasini3000
kasini3000
master

搜索帮助