Tags » PowerShell

Quick Hits: Create and Start a Stopwatch in One Line

Ok, so this is a pretty trivial thing but I happened to stumble across this while doing some work on figuring out a bottleneck in one of my scripts. 175 more words


What is Azure Resource Manager?

In the early days of Microsoft Azure the Portal was the primary tool to go in and configure your cloud components. After some time the Azure Service Manager API’s were introduced as a set of both PowerShell and Command-Line tools (X-Plat CLI). 3,200 more words


Today with PowerShell–Tuesday 26th April, 2016

Create and enter a PSSession on a remote machine in one line:

New-PSSession –ComputerName REMOTESERVER | Enter-PSSession

This assumes that Remoting is already configured.


Access Database using Powershell

function Invoke-SQL {



Begin {
$connectionString = “Data Source=$($dataSource); Integrated Security=SSPI; Initial Catalog=$($database)”

$retVal = “”

$connection = New-Object system.data.SqlClient.SQLConnection($connectionString) 64 more words

Update Excel file using Powershell

Function UpdateExcel($strQuery,$strFileName)
$strProvider = “Provider=Microsoft.ACE.OLEDB.12.0”
$strDataSource = “Data Source = $strFileName”
$strExtend = “Extended Properties=Excel 8.0”
#$strQuery = “Update [$strSheetName] set Name = ‘Som’ ” 27 more words

Read Excel using Powershell

Function ReadExcel($strQuery,$strFileName)
$strProvider = “Provider=Microsoft.ACE.OLEDB.12.0”
$strDataSource = “Data Source = $strFileName”
$strExtend = “Extended Properties=Excel 8.0”
$objConn = New-Object System.Data.OleDb.OleDbConnection(“$strProvider;$strDataSource;$strExtend”)
$sqlCommand = New-Object System.Data.OleDb.OleDbCommand($strQuery) 22 more words

Speedy Ping using PowerShell

For those that know me, you know how much I love runspaces and preach about their use for their quickness and being lightweight in PowerShell to accomplish your day to day activities where you need to run many things in parallel and at the same time want to throttle how many things run at a time. 1,050 more words