PowerShell Azure – Get-AzureExtensionHighestVersion

function Get-AzureExtensionHighestVersion {    [CmdletBinding()]    PARAM ([string]$extension, [string] $location=’AustraliaEast’)     $sortProps = @{Expression = “PublisherName”; Descending = $True}, @{Expression = “Type”; Descending = $True},@{Expression = “Version”; Descending = $True}    $Results= Get-AzureRmVmImagePublisher -Location $location |      Get-AzureRmVMExtensionImageType |       Get-AzureRmVMExtensionImage |        Where-Object {$_.Type -LIKE “*$extension*”}   #replace version…

0

Azure – DSC automation (Windows vs Linux)

{ “$schema”: “https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#”, “contentVersion”: “1.0.0.0”, “parameters”: { “OS”: { “type”: “string”, “defaultValue”: “Windows”, “allowedValues”: [ “Linux”, “Windows” ], “metadata”: { “description”: “DSC extension selection setting. Linux, Windows” } }, “vmName”: { “type”: “string”, “metadata”: { “description”: “Name of the existing VM to apply the DSC configuration to” } }, “modulesUrl”: { “type”: “string”, “defaultValue”: “https://github.com/Azure/azure-quickstart-templates/raw/master/dsc-extension-azure-automation-pullserver/UpdateLCMforAAPull.zip”,…

0

PowerShell – DSC Linux MOFs and logs

working with DSC on Linux, there are a few things to know that don’t seem to be documented anywhere obvious.  OMI stuff  lives in /opt/omi/lib /opt/omi/bin  For troubleshooting you look at the logs which are here: cat /var/opt/omi/log/omiserver.log         #the OMI CIM server cat /var/opt/omi/log/dsc.log               #the LCM and DSC logging. Start your…

0

PowerShell Azure – Invoke-AzureRmVMRunCommand

Invoke-AzureRmVMRunCommand has a parameter -CommandId which the single example shows as -CommandId ‘RunPowerShellScript’ -ScriptPath ‘sample.ps1’ but the question that raises is – what other values can I give? A colleague showed me how to get the list of various CommandId values: Get-AzureRmVMRunCommandDocument -Location AustraliaEast EnableRemotePS – Configure the machine to enable remote PowerShell. (Windows) Ipconfig – List…

2