Skip to content

Instantly share code, notes, and snippets.

View shivakumarky's full-sized avatar
🎯
Focusing

ShivakumarKY shivakumarky

🎯
Focusing
View GitHub Profile
<#
Written with version 1.3.0 of the Az PowerShell Module
Run Get-InstalledModule to check installed modules
Install PowerShell Core 6 https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6
The Az PowerShell Module is available from here https://github.com/Azure/azure-powershell/releases/tag/v1.4.0-February2019
... or run: Install-Module -Name Az -RequiredVersion 1.4.0 -AllowClobber
@lamw
lamw / gist:8fedd19e27ff9276169e1bdd5404ca8c
Created October 15, 2017 22:48
Powershell snippet to help extract the SSL Thumbprint (SHA256) of a remote system
# Modification from https://gist.github.com/lamw/988e4599c0f88d9fc25c9f2af8b72c92
# Thanks to https://stackoverflow.com/a/22251597 for SHA256 details
Function Get-SSLThumbprint256 {
param(
[Parameter(
Position=0,
Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)
]
$xmlpath = 'C:\Temp\DeploymentConfigTemplate.xml'
$features = New-Object -TypeName System.Collections.ArrayList
[xml]$xml = Get-Content $xmlpath
$xml.Objs.Obj.LST.Obj | ForEach-Object {$null = $features.Add($_.GetElementsByTagName('ToString').'#text')}
for ($i = 0; $i -lt $features.Count; $i++)
{
$features[$i] = $features[$i].Substring($features[$i].IndexOf('_') + 1).Replace('_','-')
}
$features
@lamw
lamw / Get-SSLThumbprint.ps1
Created May 22, 2016 13:37
Powershell snippet to help extract the SSL Thumbprint (SHA1) of a remote system
Function Get-SSLThumbprint {
param(
[Parameter(
Position=0,
Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true)
]
[Alias('FullName')]
[String]$URL
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"sendgridAccountName": {
"type": "string",
"metadata": {
"description": "The name of your new SendGrid account."
}
},