I encountered the following problems in the process of using Powershell Studio 2022 . But working normally in PowerShell ISE. If someone knows the problem, please tell me, thank you in advance
My system ver: windows 7 sp1 X64
powershell studio ver: 5.8.212
problem1
All built -in classes cannot display the NEW structure method. In addition, there are the same problem using a third -party library. Work normally under the ISE, See the demo and code
Code: Select all
using namespace System.Collections.Generic;
$S = [string]::new("hello")
$L1 = [List[int]]::new()
$L2 = [System.Collections.Generic.List[int]]::new()
$L3 = [System.Collections.ArrayList]
$D = [system.collections.generic.dictionary[string, int]]::new()
There is no $Matches automatic variable in the automatic completion list, which exists in ISE, See the demo problem3
All methods of the system built -in shell cannot be displayed in the list. In addition, the use of third -party COM components also has the same problem, working normally in PowerShell ISE, See the demo and code
Code: Select all
$shell = New-Object -com 'Shell.Application'
$shell
It cannot be displayed by members of the PSOBJECT object and its internal methods,In addition, the PSCUSTOMOBJECT object also has this problem, See the demo and code (In the second post below)
$obj.psobject.properties.remove('Name')
Code: Select all
$obj = New-Object -TypeName PSObject -Property @{
Name = 'Kevin'
Language = 'PowerShell'
State = 'Texas'
}
$obj.psobject.properties.remove('Name')
$obj
Can't automatically display the members and methods of adding C#class, and Unable to display the output results, working normally in PowerShell ISE, See the demo and code (In the second post below)
Code: Select all
$cs = @'
namespace Ns1
{
public class Cl1
{
public static void Hi()
{
System.Console.WriteLine("hello!");
}
}
}
'@
Add-Type -TypeDefinition $cs
[Ns1.Cl1]::Hi()