Az Command | AzureRm Command |
---|---|
Get-AzAks | Get-AzureRmAks |
New-AzAks | New-AzureRmAks |
This file contains hidden or 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 Out-Default { | |
[CmdletBinding()] | |
Param( | |
[Parameter(ValueFromPipeline)] | |
[PSObject] | |
$InputObject, | |
[switch] | |
$Transcript | |
) |
This file contains hidden or 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
#Requires -Modules AzureRM.Profile, AzureAD | |
$DeviceObjectId = '' # Set an objectID for a device | |
$SubScriptionID = '' # change with your subscription ID | |
Add-AzureRmAccount | |
$Subscription = Select-AzureRmSubscription -Subscription $SubScriptionID | |
$currentAzureContext = Get-AzureRmContext -Name $Subscription.Name | |
$TenantId = $currentAzureContext.Tenant.Id | |
$tokenCache = $currentAzureContext.TokenCache | |
$Cache = $tokenCache.ReadItems().Where({$_.ExpiresOn -gt (Get-Date) -and $_.TenantId -eq $TenantId })[0] |
I hereby claim:
- I am markekraus on github.
- I am markekraus (https://keybase.io/markekraus) on keybase.
- I have a public key ASAQRsY5KChGA8ePPV6gQ5ilSZ4KFmVciWsQL-ud4zZnGAo
To claim this, I am signing this object:
This file contains hidden or 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
Invoke-WebRequest 'google.com' | Out-MarkDown |
This file contains hidden or 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
$MyObjGlobal = [PSCustomObject]@{ | |
PSTypeName = 'MyObj' | |
Prop1 = 'Value1' | |
} | |
$MyObjFunction = [PSCustomObject]@{ | |
PSTypeName = 'MyObj' | |
Prop1 = 'Value1' | |
} |
This file contains hidden or 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 System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Management.Automation; | |
using System.Text; | |
namespace System.Management.Automation | |
{ | |
internal interface IInvokeDownloadProtocolFactory | |
{ |
This file contains hidden or 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
----------------------- Azure Web App Deployment Log ----------------------------------- | |
log_time : 2018-02-18T21:11:19.1757131Z | |
id : 9e378a01-337f-4303-bd35-39f84845320b | |
message : Updating submodules. | |
type : 0 | |
details_url : | |
log_time : 2018-02-18T21:11:19.3475551Z |
This file contains hidden or 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.Collections.Concurrent | |
$StartDate = [datetime]::UtcNow | |
# can be generated with something like | |
# 1..10 | %{ Get-Credential} | Export-CliXml -path 'C:\reports\InboxRules\Creds.xml' | |
# Which will prompt for credentials 10 times and store them in the xml file | |
$CredentialFile = 'C:\reports\InboxRules\Creds.xml' | |
$RunDate = $StartDate.ToString('o') -replace ':' | |
# This is the path of the CSV file. It is imperative that this file not be | |
# access while the script is running |
This file contains hidden or 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 ConvertTo-Base64KMSEncryptedString { | |
[CmdletBinding()] | |
param ( | |
[Parameter( | |
Mandatory = $true, | |
ValueFromPipeline = $true | |
)] | |
[String[]] | |
$String, |