Hello,
I've installed PowerShell 3.0 but now I get a different type of error:
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(10) : Expected class, delegate, enum, interface, or struct
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(9) : public string AllocatedMB;}
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(10) : >>> public string Snap1MB;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(11) : public string Snap1Name;
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...face, or struct:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(11) : Expected class, delegate, enum, interface, or struct
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(10) : public string Snap1MB;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(11) : >>> public string Snap1Name;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(12) : public string Snap2MB;
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...face, or struct:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(12) : Expected class, delegate, enum, interface, or struct
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(11) : public string Snap1Name;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(12) : >>> public string Snap2MB;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(13) : public string Snap2Name;
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...face, or struct:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(13) : Expected class, delegate, enum, interface, or struct
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(12) : public string Snap2MB;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(13) : >>> public string Snap2Name;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(14) : public string Snap3MB;
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...face, or struct:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(14) : Expected class, delegate, enum, interface, or struct
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(13) : public string Snap2Name;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(14) : >>> public string Snap3MB;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(15) : public string Snap3Name;
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...face, or struct:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(15) : Expected class, delegate, enum, interface, or struct
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(14) : public string Snap3MB;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(15) : >>> public string Snap3Name;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(16) : public string Snap4MB;
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...face, or struct:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(16) : Expected class, delegate, enum, interface, or struct
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(15) : public string Snap3Name;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(16) : >>> public string Snap4MB;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(17) : public string Snap4Name;
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...face, or struct:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(17) : Expected class, delegate, enum, interface, or struct
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(16) : public string Snap4MB;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(17) : >>> public string Snap4Name;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(18) : }
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...face, or struct:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(18) : Type or namespace definition, or end-of-file expected
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(17) : public string Snap4Name;
c:\Users\stojnov.i\AppData\Local\Temp\yykao10q.0.cs(18) : >>> }
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (c:\Users\stojno...f-file expected:CompilerError) [Add-Type], Exception
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand
Add-Type : Cannot add type. There were compilation errors.
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:21 char:1
+ Add-Type -Language CsharpVersion3 -TypeDefinition $DiskInfoDef
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Add-Type], InvalidOperationException
+ FullyQualifiedErrorId : COMPILER_ERRORS,Microsoft.PowerShell.Commands.AddTypeCommand
New-Object : Cannot find type [DiskInfo]: make sure the assembly containing this type is loaded.
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:57 char:17
+ $diskInfo = New-Object DiskInfo
+ ~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidType: (:) [New-Object], PSArgumentException
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewObjectCommand
Property 'VMname' cannot be found on this object; make sure it exists and is settable.
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:58 char:5
+ $diskInfo.VMname = $vm.Name
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
Property 'Label' cannot be found on this object; make sure it exists and is settable.
At C:\Users\stojnov.i\Desktop\Ps\yadr.ps1:59 char:5
+ $diskInfo.Label = $hd.DeviceInfo.Label
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : PropertyNotFound
... and so on...