Sometimes after installing a setup.exe with limited command line switches, we may want to clean up the Windows start menu. Usually as part of our Application Packaging best practises we remove ‘Uninstall’ shortcuts, ‘Update’ shortcuts, and shortcuts to readme’s and … Continue reading →
This is a simple example of using a Hashtable to store key/value pairs. Rather than referencing a value in an array using a numeric index, we now have named (the key) human-readable values that we can use to reference a … Continue reading →
This post provides an example of how we can use ADSI to check if a computer is a member of an AD Group using the [ADSISearcher] type accelerator: #remember that this is used as a regular expression (using -match), so … Continue reading →
This isn’t the most interesting of blog posts admittedly. But I was using the SQL Server Management Objects (SSMO) in my PowerShell script to return a result set from a stored procedure in SQL server. The data set returned from … Continue reading →
This post explains how to export to CSV using PowerShell and dynamic data. I find that hashtables are quite useful for various scenarios when scripting in PowerShell. We can also utilise them when exporting data using Export-CSV. I provide two … Continue reading →
I’ve been using Visual Studio 2013 Express to make a C# website that uses SOAP to request services from another company. Everything was working fine, until one day I suddenly started getting HTTP 500 errors. Naturally the service provider said … Continue reading →
This is just a quick one-liner that I use to get filenames and versions in folders and subfolders. I tend to use it every now and then to compare two folder structures on different machines, and then I can use … Continue reading →
Here’s a small chunk of code from a recent request asking how to write to the Windows Installer binary stream using Powershell: $msiOpenDatabaseModeReadOnly = 0 $msiOpenDatabaseModeTransact = 1 $windowsInstaller = New-Object -ComObject windowsInstaller.Installer $pathToMSI = “C:\Users\xxxx\Desktop\AlkaneExample.msi” $database2 = $windowsInstaller.GetType().InvokeMember(“OpenDatabase”, “InvokeMethod”, … Continue reading →
This post provides an example of how to count members of an AD Group and write to a CSV. This script finds all AD groups beginning with ‘MSI – ‘ or ‘App-V – ‘ and returns the number of members … Continue reading →
I needed a plugin to convert numbers to words so I started to scour the web for examples. I couldn’t find anything simple…..or that worked well. Until I stumbled upon a post by Muhammad Rashid here that seemed to work … Continue reading →