System.Uri 不包含名为 'new' 的方法

System.Uri does not contain a method named 'new'

[System.Uri]::new('http://www.whosebug.com') 失败并显示错误消息

[System.Uri] does not contain a method named 'new'

不过我能在另一个盒子上找到这个方法。并且运行良好。

如何查找在 PowerShell 下加载的 System object 之间是否存在差异

您需要 Powershell 5 或更高版本才能使用 .NET class 的 .ctor。 在旧版本的 Powershell 中,您必须使用 New-Object 来执行此操作。