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
<# | |
Written with version 2.8.0 of the Azure PowerShell Module | |
available from here https://github.com/Azure/azure-powershell/releases/tag/v2.8.0-October2019 | |
or run: Install-Module -Name Az -RequiredVersion 2.8.0 -AllowClobber | |
Migration instructions Azure.RM to Az - https://azure.microsoft.com/en-au/blog/how-to-migrate-from-azurerm-to-az-in-azure-powershell/ | |
#> | |
#$resourceGroupName = Read-Host -Prompt "Enter the Resource Group name" | |
Add-AzAccount |
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
# Switch to the Azure AzureRM PowerShell module | |
if(Get-Module -Name Az*){ | |
Remove-Module -Name Az* | |
Import-Module -Name AzureRM -Force} | |
# Switch to the Azure AZ PowerShell module ( | |
if(Get-Module -Name AzureRM*){ | |
Remove-Module -Name AzureRM* | |
Import-Module -Name Az -Force} |
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
using namespace System.Net | |
# Input bindings are passed in via param block. | |
param($Request, $TriggerMetadata) | |
# Write to the Azure Functions log stream. | |
Write-Host "PowerShell HTTP trigger function processed a request." | |
# Interact with query parameters or the body of the request. | |
$FirstName = $Request.Query.FirstName # Query based parameters |
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
######################################################### | |
####### only works if the Route template is blank ####### | |
######################################################### | |
# QUERY based parameter values - GET method | |
$firstName = 'Marc' | |
$surName = 'Kean' | |
$iwr = Invoke-WebRequest -Uri "https://ejuke2.azurewebsites.net/api/blog?firstname=$firstName&surname=$surName" -Method Get | |
$iwr.content |
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
# Fill in mandatory details for the WiFi network | |
$WirelessNetworkSSID = '<WiFi_SSID>' | |
$WirelessNetworkPassword = '<WiFi_password>' | |
$Authentication = 'WPA2PSK' # Could be WPA2 | |
$Encryption = 'AES' | |
# Create the WiFi profile, set the profile to auto connect | |
$WirelessProfile = @' | |
<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"> | |
<name>{0}</name> |
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
# Setup the Azure Functions parameters | |
# https://marcfunction1.azurewebsites.net/api/sca/scanowplaying?state={state} | |
switch -RegEx ($REQ_QUERY_STATE) | |
{ | |
\S {$state = $REQ_QUERY_STATE} | |
# https://marcfunction1.azurewebsites.net/api/sca/{state} | |
default {$state = $REQ_PARAMS_STATE} | |
} |
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
# Turn adaptive contrast on - default | |
$value = '9240' | |
New-ItemProperty -Path 'HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001' ` | |
-Name 'FeatureTestControl' -PropertyType DWORD -Value $value -Force | |
# Turn adaptive contrast off | |
$value = '9250' | |
New-ItemProperty -Path 'HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0001' ` | |
-Name 'FeatureTestControl' -PropertyType DWORD -Value $value -Force |
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
{ | |
"$connections": { | |
"value": { | |
"azureautomation": { | |
"connectionId": "/subscriptions/6bb00255-5486-4db1-96ca-5baefc18b0b2/resourceGroups/OutlookApprovalLogic/providers/Microsoft.Web/connections/azureautomation", | |
"connectionName": "azureautomation", | |
"id": "/subscriptions/6bb00255-5486-4db1-96ca-5baefc18b0b2/providers/Microsoft.Web/locations/australiaeast/managedApis/azureautomation" | |
}, | |
"office365": { | |
"connectionId": "/subscriptions/6bb00255-5486-4db1-96ca-5baefc18b0b2/resourceGroups/OutlookApprovalLogic/providers/Microsoft.Web/connections/office365", |