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
Class MyPSObject : PSObject { | |
static [MyPSObject] op_Addition ([MyPSObject] $Object1, [MyPSObject] $Object2) { | |
<# | |
$obj1 = [mypsobject] @{a = 1} | |
$obj2 = [mypsobject] @{b = 2; c = 3} | |
$obj3 = [mypsobject] @{c = 0; d = 4} | |
$obj1 + $obj2 + $obj3 | |
a c b d |
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
/** | |
* For vRO/VRA 7.0+ | |
* | |
* Workflow Inputs: | |
* payload - Properties - vRA Payload | |
* | |
* Workflow Outputs: | |
* virtualMachineAddOrUpdateProperties - Properties | |
*/ |
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
/** | |
* Test an array of strings for a valid TCP/UDP port number or a TCP/UDP port range. | |
* | |
* For vRO/VRA 7.0+ | |
* | |
* Action Inputs: | |
* values - Array/string - TCP/UDP port number | |
*/ | |
function formatError(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
/** | |
* Test an array of strings for valid IPv4 Addresses. | |
* | |
* For vRO/VRA 7.0+ | |
* | |
* Action Inputs: | |
* values - Array/string - IPv4 Addresses | |
*/ | |
if (values === null) return "A value must be specified."; |
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
/** | |
* Create Properties from Object | |
* @param {Object} obj Object | |
* @return {Properties} Properties | |
*/ | |
function createProperties(obj) { | |
var props = new Properties(); | |
for (var key in obj) { | |
// process Array | |
if (obj[key] instanceof Array) { |
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-LoggedOnUser { | |
param( | |
[string[]] $ComputerName=$env:COMPUTERNAME | |
) | |
Begin { | |
$ErrorActionPreference = 'Stop' | |
& cmd /c ver | Out-Null | |
$encoding = [Console]::OutputEncoding | |
[Console]::OutputEncoding = [System.Text.Encoding]::GetEncoding('utf-8') | |
} |
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-FolderPath { | |
<# | |
.NAME | |
Get-FolderPath | |
.SYNOPSIS | |
This cmdlet retrieves the path to the folder on a vCenter Server system. | |
.DESCRIPTION | |
This cmdlet retrieves the path to the folder on a vCenter Server system. | |
.PARAMETER Folder | |
a folder on a vCenter Server system |
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
#Requires -Version 3.0 | |
<# | |
.SYNOPSIS | |
Wraps Invoke-WmiMethod to run a command async | |
.DESCRIPTION | |
Wraps Invoke-WmiMethod to run asynchronously on a number of computers | |
.PARAMETER Computer | |
An array of computers | |
.PARAMETER Command |
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
#define VERSIONFULL '1.4.0p26'; | |
#define VERSIONSHORT '1.4.0.26'; | |
#define WAITTIME 300; | |
;check the key 'only_from' in the section [global] of the file 'check_mk.ini': | |
#define only_from '127.0.0.1 10.0.0.8'; | |
[Setup] | |
AppName=Check_MK Agent | |
AppVerName=Check_MK Agent v{#VERSIONFULL} |
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
#!/usr/bin/env python | |
# -*- encoding: utf-8; py-indent-offset: 4 -*- | |
# | |
# This script adds rules to the routing policy database | |
# | |
import ConfigParser | |
import os | |
import socket | |
import sys | |
from pyroute2 import IPRoute |
NewerOlder