This file contains hidden or 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 | |
PRTG vCenter Advanced Sensor | |
.DESCRIPTION | |
Advanced Sensor will Report vCenter Statistics about Resource usage. | |
.EXAMPLE | |
PRTG-vCenter.ps1 -VIServer vCenter.lan.local -Check DS |
This file contains hidden or 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
# Workaround for SelfSigned Cert | |
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) { | |
return true; | |
} |
This file contains hidden or 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
var SIDs_Request = RH_XXXXD2D.createRequest("GET", '/storeonceservices/cluster/servicesets/' , null); | |
SIDs_Request.setHeader('Accept', 'text/xml'); | |
var SIDs_Response = SIDs_Request.execute(); | |
var SIDs_XML = XMLManager.fromString(SIDs_Response.contentAsString); | |
var SIDs_Elements = SIDs_XML.getElementsByTagName("serviceset"); | |
var SIDs_Count = SIDs_Elements.length; | |
System.log ("Number of SIDs:" + SIDs_Count + " on " + RH_XXXXD2D.name); | |
var Stores_Count = 0; | |
for (var i = 1; i <= SIDs_Count; i++) { |
This file contains hidden or 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 | |
Moves a VM betwenn vSphere Datacenters | |
.DESCRIPTION | |
Changes Host, Datastore and Cluster. | |
.EXAMPLE | |
myMove-VM.ps1 -VMname "yourVM" -newCluster "yourCluster" -NewDS "yourDS*" -VIServer "yourvCenter.lan.local" | |
This file contains hidden or 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
$DAPs = @("DAP01.lan.local","DAP02.lan.local") #MediaSever | |
$DPCs = @("DPC01.lan.local") #Cell Server | |
$TempPath = "D:\OmniBackData\tmp" #Path to DP Temp Files | |
foreach ($DAP in $DAPs) { | |
Write-Output "Testing $DAP..." | |
if (Test-WsMan $DAP) { | |
Write-Output "Processing $DAP..." | |
Invoke-Command -ComputerName $DAP -ScriptBlock {Get-Service -Name omniInet | Stop-Service} | |
Invoke-Command -ComputerName $DAP -ScriptBlock {Get-ChildItem $TempPath | Remove-Item -Confirm:$False -Recurse} |
This file contains hidden or 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
#!/bin/bash | |
HOSTNAME=$1 | |
IP=$2 | |
SUBNET=$3 | |
GATEWAY=$4 | |
DOMAIN=$5 | |
SEARCH=$6 | |
DNS1=$7 | |
DNS2=$8 |
This file contains hidden or 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
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) { | |
return true; | |
} | |
} |
This file contains hidden or 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
$GitPath = 'C:\Users\mkraus\Documents\GitHub\PowerShell-Gallery-Test' | |
$ModuleName = 'PSGallery-Test' | |
$Author = 'Markus Kraus' | |
$Description = 'PSGallery-Test is a Test' | |
$CompanyName = 'mycloudrevolution' | |
$Copyright = '(c) 2016 Markus Kraus. All rights reserved.' | |
$ProjectUri = 'https://github.com/mycloudrevolution/PowerShell-Gallery-Test/' | |
$LicenseUri = $ProjectUri + 'LICENSE' | |
$Tags = 'mycloudrevolution','test' |
This file contains hidden or 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
$Path = 'C:\Users\mkraus\Documents\GitHub\PowerShell-Gallery-Test\PSGallery-Test' | |
$PublishParams = @{ | |
NuGetApiKey = 'your-API-key' # Swap this out with your API key | |
Path = $Path | |
} | |
Publish-Module @PublishParams | |
Find-Module PSGallery-Test |
This file contains hidden or 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
Describe 'Module Test' { | |
It 'Tests the Output of my Module' { | |
Install-Module -Name PSGallery-Test -Force; Import-Module -Name PSGallery-Test; Get-Awsome | Should Be 'Get Awsome, Learn PowerShell! (http://mycloudrevolution.com/)' | |
} | |
} |