PowerShell: Check whether a Windows command or executable is available

In one of my recent PowerShell scripts I needed to find out if certain commands (in my case “svn”, “git”, “ant” and “mvn”) were available or not. I wrote this small function that tries to call the given command and returns whether it is callable. function commandAvailable($cmd, $options) { $error.clear(); …

Continue reading

PowerShell: How to read contents from text files without converting the lines into an array

Apparently, PowerShell’s get-content cmdlet automatically converts the contents of text files into an array of strings, splitting the contents at the line breaks (see Using the Get-Content Cmdlet). In many cases this is convenient: Contents of file test.txt: 1 2 3 gc text.txt | % { write-host “line: ” $_ …

Continue reading

Getting PL/SQL Developer on Windows 7 64bit to connect to an Oracle database

After I installed the latest version of PL/SQL Developer on my Windows 7 64bit machine today, I got the following error message when trying to connect to an Oracle database: Initialization error Could not initialize “D:\oracle\product\11.2.0\client_1\bin\oci.dll” Make sure you have the 32 bits Oracle Client installed. As I’ve found out, …

Continue reading

Installation of Microsoft Baseline Security Analyzer (MBSA) fails with error code 2738

When installing Microsoft Baseline Security Analyzer (MBSA) the installation on my Windows 7 64bit machine failed with error code 2738. However, I found the solution for this problem in the Chip forum: Remove the registry key HKEY_CURRENT_USER\SOFTWARE\Classes\Wow6432Node\CLSID\. Register vbscript.dll running regsvr32 C:\Windows\SysWOW64\vbscript.dll as Administrator.

Continue reading

Windows-Installation ohne Anlegen eines lokalen Benutzerkontos

Wenn man verhindern möchte, dass Windows bei der Installation ein lokales Benutzerkonto anlegt (sinnvoll z.B. wenn der PC nur von Domänenbenutzern bedient werden soll), kann man dem obligatorischen Benutzerkonto den Namen “Benutzer” geben. Da Windows (in der deutschen Version) automatisch eine Benutzergruppe mit dem Namen Benutzer anlegt, kann das Benutzerkonto …

Continue reading