Fetch the repository succeeded.
This action will force synchronization from chuanjiao10/kasini3000, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#建议保存编码为:bom头 + utf8
param
(
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[Alias("ipaddress")][String]$被控机ip地址
)
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'
}
$global:当前被控机_ip = $null
$global:当前被控机_组 = $null
$global:当前被控机_uuid = $null
$global:当前被控机_os = $null
$global:当前被控机_esxi宿主机 = $null
& 'zd只读nodelist文件.ps1'
$当前被控机 = $global:所有被控机 | Where-Object { $_.ip -eq $被控机ip地址 }
if ($当前被控机.ip -ne $被控机ip地址)
{
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Error "nodelist文件中找不到这个ip地址: ${被控机ip地址} ,错误码11"
}
else
{
Write-Error "NODE IP was not found in the NODELIST file: ${被控机ip地址} ,error code 11"
}
$当前被控机.'被控机os类型' = '错误:nodelist文件中找不到这个ip地址'
$global:当前被控机_ip = @{ '被控机os类型' = '错误:nodelist文件中找不到这个ip地址' }
if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{
& "${global:kasini3000目录}\admin_gui\pic\bc随机报错背景图片.ps1"
}
function global:prompt
{
"`e[91m`e[44m【{0}】`e[0m{1}> " -f $global:当前被控机_ip.ip,$PWD
}
exit 11
}
[System.Net.IPAddress]$ip2 = 0
if ( [System.Net.IPAddress]::TryParse(($当前被控机.ip),[ref]$ip2) )
{
#ip地址合法
}
else
{
if ($env:LANG -eq 'zh_CN.UTF-8')
{
Write-Error "nodelist文件中找到这个ip地址: ${被控机ip地址},但ip不合法。请检查nodelist清单,ip是否重复?"
}
else
{
Write-Error "Illegal IP address found in NODELIST file: ${被控机ip地址} "
}
if ( ($IsWindows -eq $True) -or ($PSVersionTable.psversion.major -lt 6) ) #win
{
& "${global:kasini3000目录}\admin_gui\pic\bc随机报错背景图片.ps1"
}
exit 12
}
$private:已知关键字类型 = & 'linux_distribution_str.ps1'
$private:已知关键字类型 = $private:已知关键字类型 + '从linux【主控机】中,经winrm协议,控制win【被控机】,无法实现!' + '从linux【主控机】中,经wmic协议+135端口,控制win【被控机】,无法实现!'
$private:已知关键字类型 = $private:已知关键字类型 + 'win2008r2' + 'win7' + 'win8' + 'win10' + 'win2012r2' + 'win2016' + 'win2019' + '【被控机】linux发行版未知' + '【被控机】win版本未知' + '从win【主控机】中,经wmic协议+135端口,控制win【被控机】,无法实现!'
if ($当前被控机.'被控机os类型' -in $private:已知关键字类型)
{
}
else
{
& 'sx1刷新单个被控机对象的_os类型属性.ps1' -被控机ip地址 $当前被控机.ip
$当前被控机 = $global:所有被控机 | Where-Object { $_.ip -eq $被控机ip地址 }
}
$global:当前被控机_ip = $当前被控机
function global:prompt
{
"`e[37m`e[44m【{0}】`e[0m{1}> " -f $global:当前被控机_ip.ip,$PWD
}
if ($env:LANG -eq 'zh_CN.UTF-8')
{
$当前被控机 | Format-List 'ip','端口','被控机显示名','被控机os类型','用户名','被控机分组名','被控机uuid'
}
else
{
$private:a = @{Expression = { $_.'ip' };Label = 'IP' },
@{Expression = { $_.'端口' };Label = 'PORT' },
@{Expression = { $_.'被控机显示名' };Label = 'NODE NAME' },
@{Expression = { $_.'被控机os类型' };Label = 'OSTYPE' },
@{Expression = { $_.'用户名' };Label = 'USER NAME' },
@{Expression = { $_.'被控机分组名' };Label = 'NODE GROUP' },
@{Expression = { $_.'被控机uuid' };Label = 'UUID' }
$当前被控机 | Format-List $private:a
}
exit 0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。