是否有人使用https://www.powershellgallery.com/packages/ConnectWiseManageAPI/0.4.9.0中的cmdlet?
新的cwmcompanyconfiguration
我的问题来自它,它要求一些必需的参数作为哈希表。我不太确定我需要什么作为价值。不幸的是,我一直无法找到任何代码示例,这是在线使用的任何地方。
我的例子:
$Company = '250'
$name = 'API Test Device'
$type = "Servers - Linux"
$info = "test"
$IPaddress = 'test'
$ostype = 'test'
$serialnumber = 'test'
New-CWMCompanyConfiguration -company $company -name $name -type $type -_info $info -ipAddress $IPaddress -osType $ostype -serialNumber $serialnumber -verbose
它希望公司,类型和信息作为哈希表,不确定什么键/值对给它。
发布于 2022-05-03 15:33:09
我必须检查Get-CWMCompanyConfiguration返回的配置的格式。
Example of what worked:
$company = @{"id"="250"}
$name = 'API Test Device'
$type = @{"name"="Servers - Linux"}
$IPaddress = "123.123.123.123"
$ostype = "Test"
$serialnumber = "Test"
New-CWMCompanyConfiguration -company $company -name $name -type $type -ipAddress $IPaddress -osType $ostype -serialNumber $serialnumber
https://stackoverflow.com/questions/72093752
复制相似问题