Category Archives: Scripting & programming

Somthing about Powershell, VB Script, C#, VB.NET

Windows Powershell: CTRL-Space is no longer working

Hi,

the powershell has a “slimmed down intellisense” to complete commandlet names, functions, .NET types etc.
Continue reading Windows Powershell: CTRL-Space is no longer working

Powershell: Simple TCP Client and Server

Hi,

these are TCP client and server which can simply used for testing if a specific TCP port is open

Continue reading Powershell: Simple TCP Client and Server

Powershell: List .NET library/assembly references and dependencies

Hi,

.NET assemblies often have some dependencies. You can use .NET reflection tolist the dependencies:

1
2
3
4
5
6
7
8
9
10
$ASM=[Reflection.Assembly]::LoadFile("C:\temp\webdriver\lib\netstandard2.0\WebDriver.dll")
$ASM.GetReferencedAssemblies()
 
Version        Name
-------        ----
2.0.0.0        netstandard
8.0.0.0        System.Text.Json
8.0.0.0        Microsoft.Bcl.AsyncInterfaces
4.2.0.1        System.Threading.Tasks.Extensions
8.0.0.0        System.Text.Encodings.Web

When loading and you got an “Retrieve the LoaderExceptions property for more information.” add the Add-Type call into a try/catch block to get a verbose answer:

Eable logging

1
reg add HKLM\Software\Microsoft\Fusion /v EnableLog /d 1 /t REG_DWORD
1
2
3
4
5
6
7
try {
 Add-Type -Path D:\Temp\TestWebDriverNetCore\bin\Debug\net8.0\WebDriver.dll
}
catch
{
 write-host ( $_.Exception.LoaderExceptions)
}

Michael

Windows PE: .NET OpenFileDialog raises exception 80040154

Hi,

I wrote an .NET C# application where I want to use the OpenFileDialog class for chosing a file for some actions. This program should also run on Windows PE.

Continue reading Windows PE: .NET OpenFileDialog raises exception 80040154

Powershell 7: Use Powershell 7 as WinRM shell

Hi,

to enter a Powershell 7 shell over WinRM setup the machines as followed:
Continue reading Powershell 7: Use Powershell 7 as WinRM shell