Monthly Archives: April 2018

Analyzing PowerShell scripts with PSScriptAnalyzer

Hi, This post will show you how you can use PSScriptAnalyzer to analyze whether your PowerShell scripts or functions confirm with industry best practices or not. PSScriptAnalyzer (PSSA going forward) is a static code analyzer that checks your PowerShell scripts, … Continue reading

Posted in PowerShell | Tagged , , , , , , | Leave a comment

[Powershell-Basics] – Looping through hash table

Hi, This post will show how to loop through a hash table in PowerShell. Let’s say for example we have a hashTable object in PowerShell as shown below: $SampleTable = @{} # Syntax for creating hashtable –> @{} $SampleTable.”Name” = … Continue reading

Posted in PowerShell | Tagged , , , | Leave a comment

Save with Encoding in Visual Studio

Hi, This post shows how you can save files while retaining their encoding and line endings format. For example, if you’re writing a shell script that will be run on a UNIX operating system, the script is supposed to have … Continue reading

Posted in General | Tagged , , , , , , , , , , | Leave a comment

Shell script with 10+ parameters? Remember this….

Hi, This post is mainly aimed towards shell script newbies like myself and the goal is that they don’t end up wasting time on this as I had to. So, if you are creating a new shell script that requires … Continue reading

Posted in General | Tagged , , , , , , , , | Leave a comment

Get output of script executed as part of Set-AzureRmVMCustomScriptExecution cmdlet

Hi, This post explains how to retrieve the output of the script that is executed as part of Set-AzureRmVMCustomScriptExecution cmdlet. The cmdlet adds a custom script virtual machine extension to a virtual machine. It lets users run custom scripts on … Continue reading

Posted in .NET, PowerShell | Tagged , , , , , , , , | Leave a comment

Get-AutomationVariable Vs Get-AzureRmAutomationVariable

Hi, I finally started working on PowerShell and so thought that documenting my learnings here would be useful. So in this post, we will see the difference between the 2 cmdlets Get-AzureRmAutomationVariable and Get-AutomationVariable. So let’s see the outputs of … Continue reading

Posted in PowerShell | Tagged , , , , | Leave a comment