Skip to content

Various issues were discovered after upgrading to 7.5.0 #24871

@nczsl

Description

@nczsl

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

win 10; pwsh:7.5.0

Visuals

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions