(i did check the similarly named questions, the case is different)

According to https://learn.microsoft.com/en-us/dotnet/api/system.threading.thread.sleep?view=netframework-4.8 .

The subject method is static .

So i try to get it from the class, but still get the error .

Powershell

Add-Type -TypeDefinition @'

public class sc {
    public static int init(int v) {
        
        System.Threading.Thread.CurrentThread.Sleep(v);

        return 1;
    }
}

'@
[sc]::init(1000) | Write-Host
0

There are 0 best solutions below