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
# A quick fix to ensure all VMs in a Resource Pool have a CD-ROM attached. This was written specifically | |
# to deal with a problem with VMs failed over by Zerto which do not have CD-ROM drives. | |
# Example: | |
# Connect to vCenter server and run this bit of code. Substitute in your own resource pool. | |
$VMs = Get-ResourcePool | where {$_.Name -like "My Resource Pool"} | Get-VM | |
foreach ($vm in $VMs) { | |
if (-NOT ($vm | Get-CDDrive) ) { |
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
# Adapted from original code from http://geekafterfive.com/2013/03/21/simple-vm-reporting-in-vcloud-with-powercli/ | |
# Added MAC Address, Network Connection, Storage Profile and setup as a function | |
function Get-VDCVMDetails { | |
$objects = @() | |
$vms = $input | Get-CIVM | |
foreach($vm in $vms) | |
{ |
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
# Run from a PowerCLI shell that has been logged into the vCloud Director instance using “Connect-CIServer -server url” | |
# and then run the script passing the following parameters: | |
# -file or -f = The CSV file to import rules from | |
# -edge or -e = The Edge Gateway Name to import rules into | |
# Example: | |
# ./import-vse-nat-rules.ps1 -f mynatrules.csv -e “My vShield Edge” | |
param ( |
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
# Run from a PowerCLI shell that has been logged into the vCloud Director instance using “Connect-CIServer -server url” | |
# and then run the script passing the following parameters: | |
# -file or -f = The CSV file to export rules to | |
# -edge or -e = The Edge Gateway Name | |
# Example: | |
# ./export-vse-nat-rules.ps1 -f mynatrules.csv -e “My vShield Edge” | |
param ( | |
[parameter(Mandatory = $true, HelpMessage="Edge Gateway Name")][alias("-edge","e")][ValidateNotNullOrEmpty()][string[]]$egwname, |
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-VDCVMDetails { | |
# Adapted from original code from http://geekafterfive.com/2013/03/21/simple-vm-reporting-in-vcloud-with-powercli/ | |
# Added MAC Address, Network Connection, Storage Profile and setup as a function | |
$objects = @() | |
$vms = $input | Get-CIVM | |
foreach($vm in $vms) | |
{ |
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
# This script is intended to be used as part of a script to automatically create Organisation VDCs in vCloud Director. | |
# Find the Storage Profile in the Provider vDC to be added to the Org vDC | |
$BronzePvDCProfile = search-cloud -QueryType ProviderVdcStorageProfile -Name "Bronze Storage" | Get-CIView | |
# Create a new object of type VdcStorageProfileParams and fill in the parameters for the new Org vDC passing in the href of the Provider vDC Storage Profile | |
$spParams = new-object VMware.VimAutomation.Cloud.Views.VdcStorageProfileParams | |
$spParams.Limit = 512000 | |
$spParams.Units = "MB" | |
$spParams.ProviderVdcStorageProfile = $BronzePvDCProfile.href |
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
# Run from a PowerCLI shell that has been logged into the vCloud Director instance using “Connect-CIServer -server url” | |
# and then run the script passing the following parameters: | |
# -file or -f = The CSV file to export rules to | |
# -vOrg or -o = The Organisation Name (assumes the org only has one Org VDC) | |
# -vAppName or -v = The name of the vApp containing the vApp Network | |
# -vAppNet or -n = The name of the vApp Network to export firewall rules from | |
# Example: | |
# ./ExportvAppFWRules.ps1 -f myrules.csv -o MyOrg -v My_vApp -n My_vAppNetwork |
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
# created as part of the Future Learn course on Physical Computing with Raspberry Pi | |
# takes a message entered and flashes it out in morse code to an LED on gpio pin 17 | |
# numbers are missing so only letters work | |
from gpiozero import LED | |
from time import sleep | |
import sys | |
red_led = LED(17) |
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
# created as part of the Future Learn course on Physical Computing with Raspberry Pi | |
# sets off epilepsy inducing LED flashing | |
from gpiozero import LED | |
from time import sleep | |
red_led = LED(17) | |
blue_led = LED(27) | |
green_led = LED(22) |
OlderNewer