Prerequisites
Steps to reproduce
PowerShell 7.5.0
These questions are very strange. Changing a character or something in some unrelated places will result in an error. It was fine before
Such as questions like this:
9 | [PackageItem]$test = [PackageItem]::new()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the "PackageItem" value of type "PackageItem" to type "PackageItem".
InvalidOperation: E:\netenv\tool\ias\test.ps1:11:1
Line |
11 | $test.Index = 1
| ~~~~~~~~~~~~~~~
| The property 'Index' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:12:1
Line |
12 | $test.Path = "C:\Users\user\Documents\GitHub\dfw\tool\ias\script\psx\ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'Path' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:14:1
Line |
14 | $test.Show()
| ~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
MetadataError: E:\netenv\tool\ias\test.ps1:16:1
Line |
16 | [Package]$pkg = [Package]::new()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the "Package" value of type "Package" to type "Package".
InvalidOperation: E:\netenv\tool\ias\test.ps1:18:1
Line |
18 | $pkg.Name = "test"
| ~~~~~~~~~~~~~~~~~~
| The property 'Name' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:21:1
Line |
21 | $pkg.Show()
| ~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Expected behavior
9 | [PackageItem]$test = [PackageItem]::new()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the "PackageItem" value of type "PackageItem" to type "PackageItem".
InvalidOperation: E:\netenv\tool\ias\test.ps1:11:1
Line |
11 | $test.Index = 1
| ~~~~~~~~~~~~~~~
| The property 'Index' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:12:1
Line |
12 | $test.Path = "C:\Users\user\Documents\GitHub\dfw\tool\ias\script\psx\ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'Path' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:14:1
Line |
14 | $test.Show()
| ~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
MetadataError: E:\netenv\tool\ias\test.ps1:16:1
Line |
16 | [Package]$pkg = [Package]::new()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the "Package" value of type "Package" to type "Package".
InvalidOperation: E:\netenv\tool\ias\test.ps1:18:1
Line |
18 | $pkg.Name = "test"
| ~~~~~~~~~~~~~~~~~~
| The property 'Name' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:21:1
Line |
21 | $pkg.Show()
| ~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Actual behavior
9 | [PackageItem]$test = [PackageItem]::new()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the "PackageItem" value of type "PackageItem" to type "PackageItem".
InvalidOperation: E:\netenv\tool\ias\test.ps1:11:1
Line |
11 | $test.Index = 1
| ~~~~~~~~~~~~~~~
| The property 'Index' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:12:1
Line |
12 | $test.Path = "C:\Users\user\Documents\GitHub\dfw\tool\ias\script\psx\ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'Path' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:14:1
Line |
14 | $test.Show()
| ~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
MetadataError: E:\netenv\tool\ias\test.ps1:16:1
Line |
16 | [Package]$pkg = [Package]::new()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the "Package" value of type "Package" to type "Package".
InvalidOperation: E:\netenv\tool\ias\test.ps1:18:1
Line |
18 | $pkg.Name = "test"
| ~~~~~~~~~~~~~~~~~~
| The property 'Name' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:21:1
Line |
21 | $pkg.Show()
| ~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Error details
Environment data
Visuals
No response
Prerequisites
Steps to reproduce
PowerShell 7.5.0
These questions are very strange. Changing a character or something in some unrelated places will result in an error. It was fine before
Such as questions like this:
9 | [PackageItem]$test = [PackageItem]::new()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the "PackageItem" value of type "PackageItem" to type "PackageItem".
InvalidOperation: E:\netenv\tool\ias\test.ps1:11:1
Line |
11 | $test.Index = 1
| ~~~~~~~~~~~~~~~
| The property 'Index' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:12:1
Line |
12 | $test.Path = "C:\Users\user\Documents\GitHub\dfw\tool\ias\script\psx\ …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The property 'Path' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:14:1
Line |
14 | $test.Show()
| ~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
MetadataError: E:\netenv\tool\ias\test.ps1:16:1
Line |
16 | [Package]$pkg = [Package]::new()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot convert the "Package" value of type "Package" to type "Package".
InvalidOperation: E:\netenv\tool\ias\test.ps1:18:1
Line |
18 | $pkg.Name = "test"
| ~~~~~~~~~~~~~~~~~~
| The property 'Name' cannot be found on this object. Verify that the property exists and can be set.
InvalidOperation: E:\netenv\tool\ias\test.ps1:21:1
Line |
21 | $pkg.Show()
| ~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
Expected behavior
Actual behavior
Error details
Environment data
Visuals
No response