如何使用PowerShell更改本地磁盘名称?
要使用PowerShell更改本地磁盘名称,我们可以使用Set-Volume命令。例如,我们的驱动器名称为F,其卷标为“新卷”,需要将其更改为“临时存储”,然后我们可以使用其现有的卷名或驱动器号来更改标签。
要使用驱动器号更改卷名,
Set−Volume −DriveLetter 'E' −NewFileSystemLabel 'Temporary Storage'
要使用现有标签进行更改,
Set−Volume −FileSystemLabel 'New Volume' −NewFileSystemLabel 'Temporary Storage'
对于远程系统,我们可以使用Invoke-Command或CIMSession参数。
例如,
$sess = New−CimSession −ComputerName Labmachine2k12 Set−Volume −CimSession $sess −DriveLetter 'E' −NewFileSystemLabel 'Temporary Storage'
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短