This post provides the benefits of using a Powershell array of hashtables instead of a multidimensional Array. When scripting and coding a solution we’re often required to read from back-end databases. Sometimes if we want to reduce the amount of … Continue reading →
This post provides an example of using PowerShell to databind a combobox with a value and some text. Creating a combobox in Powershell and adding an item to it is a relatively trivial task: $combobox = New-Object System.Windows.Forms.ComboBox $combobox.Items.add(“alkane”) The … Continue reading →
Here’s a quick snippet that details how to get and set custom document properties in Microsoft Word 2010 documents: #Create Word application $wordApplication = New-Object -ComObject word.application #Get reference to word doc $document = $wordApplication.documents.open(“C:\temp\alkane.docx”); #set up binding flags for … Continue reading →
A useful script to set registry key permissions with Powershell. This example gives full control to the built in Users group. $acl = Get-Acl “HKLM:\SOFTWARE\Example” $person = [System.Security.Principal.NTAccount]”BuiltIn\Users” $access = [System.Security.AccessControl.RegistryRights]”FullControl” $inheritance = [System.Security.AccessControl.InheritanceFlags]”ContainerInherit,ObjectInherit” $propagation = [System.Security.AccessControl.PropagationFlags]”None” $type = [System.Security.AccessControl.AccessControlType]”Allow” … Continue reading →
This post will provides an example of how we can use ADSI to check if a user is a member of an AD Group using the [ADSISearcher] type accelerator: #remember that this is used as a regular expression (using -match), … Continue reading →
This is an example of how we can perform Rijndael encryption and decryption in C# and Powershell. It’s worth mentioning that: – salt must be 8 bytes minimum – initVector must be 16 bytes minimum The examples below use Cipher … Continue reading →
This post provides an example of getting the public key token of an assembly using PowerShell. When I need to add definitions to the web.config of my ASP.Net projects I often use this Powershell line to get the PublicKeyToken, Culture … Continue reading →
I recently needed to generate a Windows Installer transform file (MST) using PowerShell. I’ve ripped out some excerpts below to demonstrate inserting rows, querying tables, retrieving properties and generating a transform. Using this example for reference, you should be able … Continue reading →
The following posts contains common App-V 5 Powershell commands. Assuming a package consisting of the following: Package Name: AlkaneSolutions AlkaneSolutions.appv AlkaneSolutions_DeploymentConfig.xml AlkaneSolutions_UserConfig.xml and a connection group consisting of: Package Name: AlkaneSolutions_ConnectionGroup AlkaneSolutions_ConnectionGroup.xml General Commands Import the App-V 5 module (so … Continue reading →
This post describes running the x64 Powershell from x86 SCCM ConfigMgr. I stumbled upon an issue when I’d created a powershell script to manage App-V 5 packages. On an x64 platform, we tried to launch the powershell script with the … Continue reading →