The user asked how to include a RESCAN DISKS command in an SBA script – they suggest adding a couple of lines of code at the end of the script to do this. The code includes a try/catch block and the use of the Out-CUConsole command.
Read the entire ‘How to Include RESCAN DISKS in an SBA Script?’ thread below:
for this SBA: Extend partition to use all available free space
Is there anyway to incorporate a RESCAN DISKS command?
Add these lines right at the end of the script, should do the trick:
try {
`$result = "rescan" | diskpart`
`Out-CUConsole -Message $result`
}
catch {
`Out-CUConsole -Message "There was an unexpected error while rescanning the disks: $result" -Exception $_`
}
Continue reading and comment on the thread ‘How to Include RESCAN DISKS in an SBA Script?’. Not a member? Join Here!
Categories: All Archives, ControlUp Scripts & Triggers