https://keyoxide.org/3A160EC34F168B76D6958D17AC2291CF29056C5C
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 Prompt { | |
$CurrentTitle = $Host.UI.RawUI.WindowTitle | |
$Host.UI.RawUI.WindowTitle = "Loading Az ..." | |
Set-Location -Path $ENV:USERPROFILE/code -ErrorAction stop | |
$IsElevated = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") | |
if ($IsElevated) { | |
Write-Host "$([char]9788) " -ForegroundColor Red -NoNewline |
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 New-CosmosDBRESTAuthToken { | |
[CmdletBinding()] | |
Param( | |
[Parameter()] | |
[String]$Verb, | |
[Parameter()] | |
[String]$ResourceType, | |
[Parameter()] | |
[String]$ResourceId, | |
[Parameter()] |
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
$Body = @" | |
{ | |
"entries": [ | |
{ | |
"key": "name", | |
"value": { | |
"type": "string", | |
"value": "craig" | |
} | |
} |
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
$Body = @" | |
{ | |
"requestHeader": null, | |
"requestData": { | |
"entries": [ | |
{ | |
"key": "host", | |
"value": { | |
"type": "string", | |
"value": "b89d15b9-b954-4046-9d76-778edd791b99" |
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
$EscapedBusinessGroupName = [URI]::EscapeDataString($BusinessGroupName) | |
$URI = "/identity/api/tenants/$($TenantId)/subtenants?`$filter=name%20eq%20'$($EscapedBusinessGroupName)'" | |
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference |
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-AzureRMResourceTypeAPIVersion { | |
<# | |
.SYNOPSIS | |
Retrieve a list of API versions for a given ResourceTypeName | |
.DESCRIPTION | |
Retrieve a list of API versions for a given ResourceTypeName | |
.PARAMETER ProviderNamespace |
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
<# | |
.SYNOPSIS | |
Enables disk encrption on a VM | |
.DESCRIPTION | |
Enables disk encryption on a VM. The script will create a new Key Vault, Azure Active Directory Application and Service principal | |
.PARAMETER ResourceGroupName | |
The name of the resource group that contains the key vault and virtual machine |
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
/* | |
- Update IaaS Virtual Machine State | |
- Input: virtualMachineName [String] | |
*/ | |
var state = "Off"; | |
var vCACVirtualMachine = Server.findAllForType("vCAC:VirtualMachine", "VirtualMachineName eq '" + virtualMachineName + "'"); |
NewerOlder