by skufel | Sep 30, 2014 | Databases, Scripting, Windows
When you try to connect to SQL Server from PowerShell script and you get following message: Unable to find type [Microsoft.SqlServer.Management.Smo.Server] then you have to download and install following components: Microsoft System CLR Types for SQL Server 2008...
by skufel | Aug 13, 2013 | Scripting, Windows
Handy quick one to change script execution policy for PowerShell: Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force Now all scripts should work fine 🙂
by skufel | Aug 7, 2013 | Directory Services, Infrastructure, Scripting, Windows
In order to create new Forest and promote Windows Server 2012 Core to be Domain Controller for that Forest, first Active Directory Services Role has to be added: Install-WindowsFeature AD-Domain-Services –IncludeManagementTools Once Active Directory DOmain Services...
by skufel | Jul 2, 2013 | Automation, Scripting, Windows
To download file from URL I used following piece of code: $fileURL = "http://server/file.zip" $fileName = "C:\Downloads\file.zip" $webclient = New-Object System.Net.WebClient...
by skufel | Jul 2, 2013 | Scripting, Windows
Recently I needed to unzip file from PowerShell script. Here is result what I did use to achieve that: $archiveDir = "C:\Downloads" $fileZip = $archiveDir + "\file.zip" $shell=new-object -com shell.application $zip = $shell.NameSpace($fileZip)...