Skip to content

Instantly share code, notes, and snippets.

View vMarkusK's full-sized avatar

Markus Kraus vMarkusK

View GitHub Profile
@vMarkusK
vMarkusK / Start-UNMAP.psm1
Created September 26, 2016 08:44
This Function will process SCSI UNMAP on VMware Datastores via ESXCLI -V2
function Start-UNMAP {
<#
.SYNOPSIS
Process SCSI UNMAP on VMware Datastores
.DESCRIPTION
This Function will process SCSI UNMAP on VMware Datastores via ESXCLI -V2
.Example
Start-UNMAP -ClusterName myCluster -DSWildcard *RAID5*
@vMarkusK
vMarkusK / Recommend-Sizing.psm1
Last active December 5, 2016 11:37
This Function collects Basic vSphere Informations for a Hardware Sizing Recomamndation. Focus is in Compute Ressources.
function Get-VMmaxIOPS {
<#
.NOTES
===========================================================================
Created by: Markus Kraus
Twitter: @VMarkus_K
Private Blog: mycloudrevolution.com
===========================================================================
Changelog:
2016.10 ver 1.0 Base Release
@vMarkusK
vMarkusK / Konfig-ESXi.psm1
Created December 22, 2016 22:27
Sets the Basic settings for a new ESXi
function Konfig-ESXi {
<#
.NOTES
===========================================================================
Created by: Markus Kraus
Twitter: @VMarkus_K
Private Blog: mycloudrevolution.com
===========================================================================
Changelog:
2016.12 ver 1.0 Base Release
@vMarkusK
vMarkusK / NatRules.ps1
Created June 7, 2017 11:25 — forked from alanrenouf/NatRules.ps1
Working with vCD Edge Gateway Rules in PowerCLI
Function New-DNATRule (
$EdgeGateway,
$ExternalNetwork,
$OriginalIP,
$OriginalPort,
$TranslatedIP,
$TranslatedPort,
$Protocol) {
$Edgeview = Search-Cloud -QueryType EdgeGateway -name $EdgeGateway | Get-CIView
if (!$Edgeview) {
function New-VeeamTenant {
<#
.SYNOPSIS
Creates a vCloud Tenant Configuguration for Veeam Backuo & Replication
.DESCRIPTION
Creates a vCloud tenent Configuration for Veeam Backup & Replication.
The Function leverages the Veeam Ent. Manager API. The Backup Jobs need to be created seperate
@vMarkusK
vMarkusK / VeeamBR95-Silent.ps1
Created August 2, 2017 10:32
Veeam Availability Suite Unattended Install with PowerShell
# Requires PowerShell 5.1
# Requires .Net 4.5.2 and Reboot
#region: Variables
$source = "X:"
$licensefile = "C:\_install\veeam.lic"
$username = "svc_veeam"
$fulluser = $env:COMPUTERNAME+ "\" + $username
$password = "Password!"
$CatalogPath = "D:\VbrCatalog"
@vMarkusK
vMarkusK / removeDuplicatesFromArray.js
Created September 21, 2017 10:19
vRealize Orchestrator - remove Duplicates From Array
// VMware vRealize Orchestrator action sample
//
// Removes duplicates from an array, with the option to also sort the array
//
// For vRO 6.0+
//
// Action Inputs:
// a - Array/Any - Array with potential duplicates
// doSort - boolean - Sort the array also? Potentially better performance than unsorted algorithm
//
@vMarkusK
vMarkusK / vRops-Veeam.ps1
Last active February 16, 2018 08:37
Push Custom Properties about Veeam Protection into VMware vRealize Operations Manager
#Credits: http://vman.ch/vrops-suite-api-properties-import/
#region: SSL Config for SelfSigned Cert and force TLS 1.2
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
@vMarkusK
vMarkusK / ESXi-Depot-Install-ESXCLI.ps1
Created February 22, 2018 08:55
This PowerCLI Script Uploads and Installs a ESXi Depot Package via ESXCLI -v2
[String]$ClusterName = "Compute01"
[String]$LocalPath = "D:\Image\HPE-20180220.zip"
[String]$DepotName = "HPE-20180220.zip"
[String]$TempDatastoreName = "LOCAL*"
$VMhosts = Get-Cluster -Name $ClusterName | Get-VMHost | Where-Object {$_.ConnectionState -eq "Maintenance"}
foreach ($VMhost in $VMhosts) {
#region: Upload Patch
$Datastore = $VMhost | Get-Datastore -Name $TempDatastoreName
@vMarkusK
vMarkusK / ESXi-NetApp-Config.ps1
Created February 22, 2018 09:34
This Script Configures ESXi DNS, NTP, SSH, PowerProfile and NetApp Advanced Options
function Set-MyESXiOption {
[CmdletBinding()]
param(
[Parameter(Mandatory=$True, ValueFromPipeline=$False, Position=0)]
[String] $Name,
[Parameter(Mandatory=$False, ValueFromPipeline=$False, Position=1)]
[String] $Value
)
process {
$myESXiOption = Get-AdvancedSetting -Entity $VMhost -Name $Name