Table of Contents

PowerShell

check policy

Commands

$PSVersionTable.PSVersion                                                                                 #get version
Get-Module -Name PowerShellGet -ListAvailable | Select-Object -Property Name,Version,Path                 #
Import-Module PowerShellGet -Force                                                                        #Update Powershell version
Get-ExecutionPolicy                                                                                       #check policy
Set-ExecutionPolicy Unrestricted                                                                          #set policy to unrestricted
Install-Module -Name AZureRM -AllowClobber                                                                #install azure module
Import-Module -Name AzureRM                                                                               #import azure module - "Get-ExecutionPolicy" has to be set to unrestricted!
Login-AzureRmAccount                                                                                      #login

Azure CLI

https://docs.microsoft.com/de-de/cli/azure/install-azure-cli?view=azure-cli-latest

Powershell install:

Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'
az login --use-device-code                                                                                #generate url + machine-code
az login
az group list --out table                                                                                 #show resource groups
windows/powershell.txt · Last modified: 2019/12/18 19:05 by tmade
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki