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
//input: userEmail [String] | |
//input: vmHost [VC:Host] | |
var csv = "" | |
// Setup Mail Client | |
var message = new EmailMessage(); | |
message.smtpHost = "smtp-host@org.co.uk"; | |
message.fromName = "vCenter Orchestrator"; | |
message.fromAddress = "noreply@org.co.uk"; |
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
//vRO Scriptable task to parse a resource element and | |
//edit values | |
//inputs: | |
//jsonTemplate : ResourceElement | |
//reservationName : String | |
//subtenantId : String | |
//outputs | |
//payload : String |
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 uri for the latest release | |
$URI = "https://api.github.com/repos/chelnak/vRAAPIClient/releases/latest" | |
# --- Query the API to get the url of the zip | |
$Response = Invoke-RestMethod -Method Get -Uri $URI | |
$ZipUrl = $Response.zipball_url | |
# --- Download the file to the current location | |
$OutputPath = "$((Get-Location).Path)\$($Response.name.Replace(" ","_")).zip" | |
Invoke-RestMethod -Method Get -Uri $ZipUrl -OutFile $OutputPath |
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
/* | |
Name: getLinkProperties | |
Input: vCACHost - vCAC:VCACHost | |
Input: vCACVirtualMachine - vCAC:VirtualMachine | |
Description: List the properties for a vCAC entity object link | |
*/ | |
//Set the name of the link here: | |
var linkName = "VMDiskHardware"; |
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
$URI = "/catalog-service/api/consumer/resourceViews/?withExtendedData=$($WithExtendedData)&withOperations=$($WithOperations)&managedOnly=$($ManagedOnly)&`$orderby=name asc&limit=$($Limit)&page=$($page)&`$filter=resourceType/id eq 'Infrastructure.Machine' or resourceType/id eq 'Infrastructure.Virtual' or resourceType/id eq 'Infrastructure.Cloud' or resourceType/id eq 'Infrastructure.Physical'" | |
$EscapedURI = [uri]::EscapeUriString($URI) | |
$Response = Invoke-vRARestMethod -Method GET -URI $EscapedURI -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
/* | |
- Retrieve the email address of a user principal | |
- Input: vCACCAFEHost [vCACCAFE:vCACHost] | |
- Input: principalId [String] | |
- Output: emailAddress [String] | |
*/ | |
var tenant = vCACCAFEHost.tenant; |
NewerOlder