- Tim Warner
- Twitter: @TechTrainerTim
- Website: https://timw.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-ARMVM | |
{ | |
$RGs = Get-AzureRMResourceGroup | |
foreach($RG in $RGs) | |
{ | |
$VMs = Get-AzureRmVM -ResourceGroupName $RG.ResourceGroupName | |
foreach($VM in $VMs) | |
{ | |
$VMDetail = Get-AzureRmVM -ResourceGroupName $RG.ResourceGroupName -Name $VM.Name -Status | |
$RGN = $VMDetail.ResourceGroupName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Path = $env:TEMP; $Installer = 'chrome_installer.exe'; Invoke-WebRequest -Uri 'http://dl.google.com/chrome/install/375.126/chrome_installer.exe' -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args '/silent /install' -Verb RunAs -Wait; Remove-Item -Path $Path\$Installer | |
# Thank you, nicolaigj! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-Location -Path (Split-Path -Path $psISE.CurrentFile.FullPath) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Workflow Reset-AzureRmVM | |
{ | |
Param | |
( | |
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()] | |
[String] | |
$AzureSubscriptionId='', | |
[Parameter(Mandatory=$true)][ValidateNotNullOrEmpty()] | |
[String] | |
$AzureVMList='', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// Set the default PowerShell engine for VSCode integrated terminal | |
"terminal.integrated.shell.windows": "c:/Program Files/PowerShell/6/pwsh.exe", | |
// Create Shell Launcher launch options | |
"shellLauncher.shells.windows": [ | |
{ | |
"shell": "c:\\Program Files\\PowerShell\\6\\pwsh.exe", | |
"label": "PowerShell Core" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cert = New-SelfSignedCertificate -CertStoreLocation "cert:\CurrentUser\My" ` | |
-Subject "CN=psauth1" ` | |
-KeySpec KeyExchange | |
$keyValue = [System.Convert]::ToBase64String($cert.GetRawCertData()) | |
$sp = New-AzADServicePrincipal -DisplayName 'psauth1' ` | |
-CertValue $keyValue ` | |
-EndDate $cert.NotAfter ` | |
-StartDate $cert.NotBefore | |
Start-Sleep -Seconds 20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to Will Anderson for the inspiration (timw.info/rss) | |
Function Get-AzServiceStatus { | |
BEGIN { | |
Try { | |
Invoke-WebRequest -Uri 'https://azurecomcdn.azureedge.net/en-us/status/feed/' -OutFile "$env:TEMP\test.xml" -ErrorAction Stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Path . -Filter *.zip | Expand-Archive -DestinationPath . -Force | Measure-Command | |
Get-ChildItem -Path . | Expand-Archive -Path .\*.zip -DestinationPath . -Force |
How to Become a Microsoft MVP (https://timw.info/mvp)
OlderNewer