【发布时间】:2015-10-06 13:38:41
【问题描述】:
当从 VirtualMachineManager 模块运行 Get-SCVirtualDiskDrive 命令时,没有特别的特殊方式。
Get-SCVirtualDiskDrive -VMMServer $VMMServer -VM $VMName
我收到公共语言特定 (CLS) 错误
format-default :字段或属性:“Lun”,类型:“Microsoft.SystemCenter.VirtualMachineManager.VirtualDiskDrive”仅在字母大小写方面与字段不同 或属性:“LUN”。该类型必须符合公共语言规范 (CLS)。 + CategoryInfo : NotSpecified: (:) [format-default], ExtendedTypeSystemException + FullyQualifiedErrorId : NotACLSComplaintProperty,Microsoft.PowerShell.Commands.FormatDefaultCommand
我很难通过我在网上找到的关于 .NET 和 PowerShell 的一些提示来让这个命令正常工作
这行代码有效
$method1 = [Microsoft.SystemCenter.VirtualMachineManager.VirtualDiskDrive].GetMethod("get_LUN")
我真的希望这行代码能返回一些东西,但不,它什么也没有返回......
$method2 = [Microsoft.SystemCenter.VirtualMachineManager.VirtualDiskDrive].GetMethod("get_Lun")
除了让这条线工作之外,该脚本的目的是扩展虚拟机主 VHD。我真的希望有人可以在这里提供帮助,这不是我第一次遇到问题,但这一次,这是不可避免的。
【问题讨论】:
标签: .net powershell virtual-machine clr virtualization