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
# my function | |
Function Test-InvokeVMScript | |
{ | |
<# | |
[removed] | |
#> | |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory)] |
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
[CmdletBinding()] | |
param() | |
function Start-DAVLog | |
{ | |
[cmdletBinding()] | |
param( | |
[Parameter(Mandatory)] | |
[string]$logFile | |
, |
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
foreach ($vCenter in $vCenters) { | |
foreach ($template in $templates) { | |
# try to convert the current template to a VM | |
try { | |
Write-Verbose "Trying to convert template $($template.name) to a VM." | |
Set-Template -Template $template -ToVM -ErrorAction Stop | |
Write-Verbose "Successfully converted template $($template.name) to a VM." | |
} | |
catch { | |
Write-Verbose "Failed to convert template $($template.name) to a VM with the following exception." |
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
# script used to incremenelty install windows udpates | |
# expects the PSWindowsUpdate module to be installed | |
# needs to be run by a packer powershell provisioner at least 4 times in a row with reboots in between (4x depends on your OS) | |
# no longer used since https://github.com/rgl/packer-provisioner-windows-update came to be with https://github.com/rgl/packer-provisioner-windows-update/pull/4 | |
$UpdateLimit = 50 | |
$updates = Get-WUList | |
if ($updates) | |
{ | |
Write-Host "$($updates.count) total updates found for install." -ForegroundColor Green |
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
[CmdletBinding()] | |
param() | |
function Start-Log | |
{ | |
[cmdletBinding()] | |
param( | |
[Parameter(Mandatory)] | |
[string]$logFile | |
, |
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 Get-ClusterDatastoreClusters | |
{ | |
param | |
( | |
[CmdletBinding()] | |
[Parameter(Mandatory)] | |
[string]$Cluster | |
) | |
begin |
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 Get-ClusterPortGroups | |
{ | |
param | |
( | |
[CmdletBinding()] | |
[Parameter(Mandatory)] | |
[string]$Cluster | |
) | |
begin |
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 Validate-IPAddress | |
{ | |
param | |
( | |
[Parameter()] | |
[string]$IP | |
) | |
if (($ip -as [ipaddress]) -and (($IP.Split('.'))).count -eq 4) | |
{ | |
Write-Output $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
function Test-Unique | |
{ | |
param | |
( | |
[Parameter()] | |
[array]$strings | |
) | |
$stringsraw = $strings | |
# an awful way to check for not null or empty on the pipeline. don't judge |
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
## site.pp ## | |
# This file (/etc/puppetlabs/puppet/manifests/site.pp) is the main entry point | |
# used when an agent connects to a master and asks for an updated configuration. | |
# | |
# Global objects like filebuckets and resource defaults should go in this file, | |
# as should the default node definition. (The default node can be omitted | |
# if you use the console and don't define any other nodes in site.pp. See | |
# http://docs.puppetlabs.com/guides/language_guide.html#nodes for more on | |
# node definitions.) |