-
Install sqlps as a PowerShell module
Most of SQL Server automation scripts using PowerShell use SMO directly. For example, one would do something like: [System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SqlServer.SMO”) $MyServer = new-object (‘Microsoft.SqlServer.Management.Smo.Server’) ‘HOME’ $MyDataBase = new-object (‘Microsoft.SqlServer.Management.Smo.Database’) ($Server, “MyDataBase”) That’s a lot of typing and looks messy and cumbersome. Since SQL Server 2008, Microsoft provides a sqlps shell which exposes a lot of SQL…
-
Cliffs Notes: administrating Active Directory with PowerShell
1. Install ActiveDirectory modules by running PowerShell as Administrator and executing the commands below: [code language=”text”] PS C:\Windows\system32> Import-Module ServerManager PS C:\Windows\system32> Add-WindowsFeature RSAT-AD-PowerShell Success Restart Needed Exit Code Feature Result ——- ————– ——— ————– True No Success {Active Directory module for Windows Power… [/code] 2. Link for newly added Active Directory cmdlets after installation,…
-
PowerShell TDD with PSUnit: some usage examples
I discussed setting up PSUnit for unit testing PowerShell before. This is a quick followup for my own record and consumption in the future. I will update this post as I find more interesting things to record. 1. Put PowerShell functions in one file such as myBaseFunctions.ps1; 2. Create a test directory and under that…
-
Installing ack on Windows with ActiveState Perl
-
PowerShell TDD with PSUnit