Posted in
Windows Powershell,
Windows Server |
No Comment | 1,187 views | 07/01/2014 15:03
You can use this example to get disk indexes to use it in other orchestrator tasks like Disk Format.
1
2
3
4
5
6
7
8
9
10
11
| $VMName = $PoSHQuery.VMName
$Snapshot = Get-WmiObject Win32_DiskDrive -ComputerName $VMName
$DiskIndex = "index"
foreach ($DiskItems in $Snapshot)
{
$Index = $DiskItems.Index
$DiskIndex += ";$Index"
}
@"
$($DiskIndex)
"@ |
$VMName = $PoSHQuery.VMName
$Snapshot = Get-WmiObject Win32_DiskDrive -ComputerName $VMName
$DiskIndex = "index"
foreach ($DiskItems in $Snapshot)
{
$Index = $DiskItems.Index
$DiskIndex += ";$Index"
}
@"
$($DiskIndex)
"@
Result gives you current disk indexes in remote server.