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
# Start Load VMware Snapin (if not already loaded) | |
if (!(Get-PSSnapin -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) { | |
if (!(Add-PSSnapin -PassThru VMware.VimAutomation.Core)) { | |
# Error out if loading fails | |
Write-Error "ERROR: Cannot load the VMware Snapin. Is the PowerCLI installed?" | |
Exit | |
} | |
} | |
# End Load VMware Snapin (if not already loaded) |
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
Function Set-ConsolidationFix { | |
[cmdletbinding()] | |
param ( | |
#[parameter(Mandatory=$true)] | |
[parameter(Mandatory=$true,ValueFromPipeline=$true)] | |
[VMware.VimAutomation.ViCore.Types.V1.Inventory.VirtualMachine]$myVM, | |
[parameter(Mandatory=$true)] | |
[string]$Fix = "Timeout" # Timeout or Stun |
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
# Start of Settings | |
# Set the maximum number of paths per LUN | |
$MaxLUNPaths = 4 | |
# End of Settings | |
$myHosts = $VMH | where {$_.ConnectionState -eq "Connected" -and $_.PowerState -eq "PoweredOn"} | |
$Report = @() | |
foreach ($myHost in $myHosts) { | |
$esxcli2 = Get-ESXCLI -VMHost $myHost -V2 |
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
# Start Load VMware Snapin (if not already loaded) | |
if (!(Get-PSSnapin -Name VMware.VimAutomation.Core -ErrorAction SilentlyContinue)) { | |
if (!(Add-PSSnapin -PassThru VMware.VimAutomation.Core)) { | |
# Error out if loading fails | |
Write-Error "ERROR: Cannot load the VMware Snapin. Is the PowerCLI installed?" | |
Exit | |
} | |
} | |
# End Load VMware Snapin (if not already loaded) |
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 | |
Tells you how to get Awsome. | |
.DESCRIPTION | |
Tells you how to get Awsome. | |
.EXAMPLE | |
Get-Awsome | |
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/)' | |
} | |
} |
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
$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
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
#!/bin/bash | |
HOSTNAME=$1 | |
IP=$2 | |
SUBNET=$3 | |
GATEWAY=$4 | |
DOMAIN=$5 | |
SEARCH=$6 | |
DNS1=$7 | |
DNS2=$8 |