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
import-module webadministration | |
$name = "Block API Help" | |
$site = 'IIS:\Sites\Default Web Site' | |
$root = '/system.webServer/rewrite/rules' | |
$filter = "{0}/rule[@name='{1}']" -f $root, $name | |
Add-WebConfigurationProperty -pspath $site -filter $root -name "." -value @{name='Block API Help'; patternSyntax='Wildcard'; stopProcessing='True'} | |
Set-WebConfigurationProperty -pspath $site -filter $filter/match -name "url" -value "*" | |
Add-WebConfigurationProperty -pspath $site -filter $filter/conditions -name "." -value @{logicalGrouping="MatchAll"; input="{URL}"; pattern='/api/help/*'} | |
Set-WebConfigurationProperty -pspath $site -filter $filter/action -name "type" -value "CustomResponse" |
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 | |
Configures a secure WinRM listener over HTTPS to enable | |
SSL-based WinRM communications. This script has not been | |
tested on Windows Server 2003R2 or earier, and may not | |
work on these OSes for a variety of reasons. | |
If Windows Remote Management is disabled (e.g. service | |
stopped, GPO Policy, etc.), this script will likely fail. | |
.DESCRIPTION |
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 was an interesting thing I was trying to figure out. I used this to pass into a IAM Policy Resource Limit | |
# Get all of the subents with tag packer; returns a set of ids | |
data "aws_subnet_ids" "this" { | |
vpc_id = var.vpc_id | |
tags = { | |
tag_name = "tag_value" | |
} | |
} |
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
//Description: vRO Action to get the Create a virtual disk config spec | |
//Inputs: [Any] sizeInGb, [string] datastore, [number] controllerKey, [number] diskIndex, [VC:VirtualDiskMode] diskMode, [boolean] thinProvisioned, [string] sharingType, [number] diskKey | |
//Return Type: Any | |
// Create Disk BackingInfo | |
var diskBackingInfo = new VcVirtualDiskFlatVer2BackingInfo(); | |
diskBackingInfo.diskMode = diskMode.value; | |
var datastorePath = "[" + datastore + "]"; | |
diskBackingInfo.fileName = datastorePath; | |
diskBackingInfo.thinProvisioned = thinProvisioned; |
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
//Description: vRO Action to execute a vm reconfig task | |
//Inputs: [Array/Any] deviceConfigSpecs, [VC:VirtualMachine] vm | |
//Return Type: VC:Task | |
var configSpec = new VcVirtualMachineConfigSpec(); | |
configSpec.deviceChange = deviceConfigSpecs; | |
return vm.reconfigVM_Task(configSpec); |
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
//Description: vRO Action to get the SCSI Controller number for a vm and bus number | |
//Inputs: [VC:VirtualMachine] vm, [Number] scsiBusNumber | |
//Return Type: number | |
//Inputs: vm, scsiBusNumber | |
//Outputs scsiControllerKey | |
scsiControllerKey = -1; | |
var devices = vm.config.hardware.device; | |
var isScsiBusNumberInvalid = true; |
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
//Description: vRO Action to get next SCSI bus number for a given VC:VirtualMachine | |
//Inputs: [VC:VirtualMachine] virtualMachine | |
//Return Type: number | |
//Get next scsi bus number | |
var devices = virtualMachine.config.hardware.device; | |
if (devices != null) { | |
var highBusNumber = -1; | |
for each (device in devices){ | |
System.debug(device); |
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
//Description Used by vRO to create a ParaVirtual SCSI Controller Config Spec | |
//Inputs: [string] type, [number] nextBusNumber | |
//Return Type: Any | |
// Create SCSI controller | |
var controller = null; | |
if ( type != null && "LSI".equalsIgnoreCase( type.toUpperCase() ) == true ) { | |
controller = new VcVirtualLsiLogicController(); | |
}else if(type != null && "PARA".equalsIgnoreCase( type.toUpperCase() ) == true){ | |
controller = new VcParaVirtualSCSIController(); |
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
//Inputs: vapiEndpoint [VAPI:VAPIEndpoint], object_id_type [string], object_id_id [string], tag_id [string] | |
//Outputs: void | |
var object_id = new com_vmware_vapi_std_dynamic__ID() | |
object_id.type = object_id_type; | |
object_id.id = object_id_id; | |
var client = vapiEndpoint.client(); | |
var service = new com_vmware_cis_tagging_tag__association(client); | |
service.attach(tag_id,object_id); | |
client.close(); |
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: endpoint [VAPI:VAPIEndpoint] | |
//Return: Array/string | |
if(!endpoint){ | |
return null | |
} | |
var client = endpoint.client(); | |
var categories = new com_vmware_cis_tagging_category(client) ; | |
var catArray = []; |
NewerOlder