加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

Windows 2008 R2 powershell术语“Get-Disk”无法识别为cmdlet的

发布时间:2020-12-14 02:03:36 所属栏目:Windows 来源:网络整理
导读:使用Get-Disk cmdlet时出错 Windows版本:Microsoft Windows Server 2008 R2 SP1 64b Windows 2008 R2 powershell术语“Get-Disk”无法识别为cmdlet的名称.我有Powershell的第3版 PS C:Windowssystem32 Get-Disk Get-Disk : The term 'Get-Disk' is not re
使用Get-Disk cmdlet时出错

Windows版本:Microsoft Windows Server 2008 R2 SP1 64b

Windows 2008 R2 powershell术语“Get-Disk”无法识别为cmdlet的名称.我有Powershell的第3版

PS C:Windowssystem32> Get-Disk

Get-Disk : The term 'Get-Disk' is not recognized as the name of a cmdlet,function,script file,or operable program. Check the spelling of the name,or if a path was 
included,verify that the path is correct and try again.
At line:1 char:1
+ Get-Disk
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Get-Disk:String) [],CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:Windowssystem32> $PSVersionTable`

Name                           Value
----                           -----
WSManStackVersion              3.0
PSCompatibleVersions           {1.0,2.0,3.0}
SerializationVersion           1.1.0.1
BuildVersion                   6.2.9200.16398
PSVersion                      3.0
CLRVersion                     4.0.30319.1
PSRemotingProtocolVersion      2.2

解决方法

[只是将评论结合到答案中并添加了一点]

我还希望在Azure VM Server 2008 R2上使用Get-Disk命令,我安装的PowerShell 3.0和Get-Disk仍然不可用,然后用Google搜索到此页面.

从这个Scripting Guy blog link开始,它提到了这一点

Note The version of Windows PowerShell 3.0 for Windows 7 does not
contain the Storage module at this time,so Windows 8 or Windows
Server 2012 is a requirement.

因此,如果您希望在Windows Server 2008 R2上使用Get-Disk,那么您无法做到.

相同的Scripting Guy链接还提供了可以使用的相关DiskPart命令.

From an elevated shell:

    DiskPart.exe
    List disk
    Select disk 1—disk 1 being the USB drive
    Clean
    Create partition primary
    Select partition 1—partition 1 being the new partition
    Active
    Format FS=NTFS

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读