Skip to content

Instantly share code, notes, and snippets.

ilandcloud

Block or report user

Report or block ilandcloud

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View metadata-csv-export.ps1
# Set up an array for the final report
$report = @()
# Get all vApp from the Org
$vApps = Get-CIVApp
foreach ($vApp in $vApps) {
# Get the metadata key/value pairs for all vApps
$Metadatas = Get-CIMetaData -CIObject $vApp
View update-metadata.ps1
Connect-CIServer -server ‘sin01.ilandcloud.com-User ‘username’ -Password ‘password’ -Org ‘YourOrg
# Read existing CSV file with metadata requirements
$file = 'c:\temp\metadata.csv'
# Read the CSV file into an array
$requirements = Import-Csv -Path $file
# Trundle through the array, getting the requirements per vApp
foreach ($requirement in $requirements){
$vApp = $requirement.vApp
View New-CIMetaData.ps1
Function New-CIMetaData {
<#
.SYNOPSIS
Creates a Metadata Key/Value pair.
.DESCRIPTION
Creates a custom Metadata Key/Value pair on a specified vCloud object
.PARAMETER Key
The name of the Metadata to be applied.
.PARAMETER Value
View automatic-shutdown.ps1
# Connect to iland cloud
Connect-CIServer -server ‘sin01.ilandcloud.com-User ‘username’ -Password ‘password’ -Org ‘YourOrg
# Get the current time, and specifically hour in 24 hour format
$time = Get-Date -DisplayHint Time
$today = Get-Date -UFormat %a
$hour = $time.Hour
# Get a list of all the vApps in the Org
$vApps = Get-CIVApp
@ilandcloud
ilandcloud / Get-CIMetadata.ps1
Last active Oct 13, 2016
This is a custom-developed cmdlet from velemental.com. This can be referenced as part of your Powershell profile, or just included at the top of your script. http://velemental.com/2012/03/29/managing-metadata-in-vcd-with-powercli/
View Get-CIMetadata.ps1
Function Get-CIMetaData {
<#
.SYNOPSIS
Retrieves all Metadata Key/Value pairs.
.DESCRIPTION
Retrieves all custom Metadata Key/Value pairs on a specified vCloud object
.PARAMETER CIObject
The object on which to retrieve the Metadata.
@ilandcloud
ilandcloud / get-CIVapp.ps1
Created Oct 12, 2016
The ‘AutoOnOff’ key on its own can be used for a really simple script that checks for the existence of the key and the value being set to ‘Yes’, and will then shut it down.
View get-CIVapp.ps1
$vApps = Get-CIVApp
$Metadatas = Get-CIMetaData -CIObject $vApps
foreach ($Metadata in $Metadatas) {
$vApp = $Metadata.CIObject
$Key = $Metadata.Key
$Value = $Metadata.Value
if ($Value -like 'Yes') {write-host 'Stopping vApp....',$vApp}
if ($Value -like 'Yes') {Stop-CIVApp -VApp $vApp -Confirm:$false}
}
You can’t perform that action at this time.