I want to use set-disk to put a usb drive in offline or unmount state, but I can't. Why does 'set-disk -number 2 -isoffline $false' work but 'set-disk -number 2 -isoffline $true' does not? And when does it work?
If you don't mind, please tell me how to put removal media into unmount state by poweshell.
PS C:\WINDOWS\system32> set-disk -number 2 -isoffline $false
PS C:\WINDOWS\system32> get-partition -disknumber 2 | format-list
UniqueId : ~~~
AccessPaths : {W:\, \\?\Volume~~~
DiskNumber : 2
DiskPath : ~~~
DriveLetter : W
Guid :
IsActive : False
IsBoot : False
IsHidden :
IsOffline : False
IsReadOnly :
IsShadowCopy :
IsDAX :
IsSystem : False
NoDefaultDriveLetter :
Offset : 1048576
OperationalStatus : Online
PartitionNumber : 1
Size : 28.87 GB
Type : FAT32 XINT13
PS C:\WINDOWS\system32> set-disk -number 2 -isoffline $true
set-disk : Not Supported
Extended information:
Removable media cannot be set to offline.
~~~