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 Resolve-DnsLogEntry { | |
| param ( | |
| [String]$DnsLogLine | |
| ) | |
| $PropertyList = @{ | |
| Date = 0 | |
| Time = 1 | |
| ThreadID = 2 | |
| Context = 3 |
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-DockerInfo { | |
| $rtnObj = New-Object PSCustomObject | |
| if (Get-Command "docker" -ErrorAction SilentlyContinue) { | |
| $dockerArr = (docker version 2>0) -split '\n' | Select-Object -First 2 | ForEach-Object {($_ -replace "^.*:").trim()} | |
| foreach ($dockerProp in $dockerArr) { | |
| switch -regex ($dockerProp) { | |
| "^Docker.*" { | |
| $rtnObj | Add-Member -MemberType NoteProperty -Name "DockerName" -Value $dockerProp | |
| } | |
| "^\d{2}\.\d{2}\.\d{2}" { |
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
| # Variables | |
| ########### | |
| $siteServerName = "CMTP_Server1" | |
| $domainLDAP = "dc=decline,dc=lab" | |
| # System Management Container | |
| ############################# | |
| New-ADObject -Name "System Management" -Type Container -Path ("Cn=system," + $domainLDAP) |
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-ThumbprintFromCertFile { | |
| param ( | |
| [Parameter(Mandatory)] | |
| [ValidateScript({Test-Path $_})] | |
| [ValidatePattern(".*\.cer")] | |
| [String]$CertificatePath | |
| ) | |
| $CertificatePath = (Get-Item $CertificatePath).FullName | |
| try { |
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
| #Requires -Version 3.0 | |
| # Configure a Windows host for remote management with Ansible | |
| # ----------------------------------------------------------- | |
| # | |
| # This script checks the current WinRM (PS Remoting) configuration and makes | |
| # the necessary changes to allow Ansible to connect, authenticate and | |
| # execute PowerShell commands. | |
| # | |
| # All events are logged to the Windows EventLog, useful for unattended runs. |
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
| param ( | |
| [Parameter(Mandatory)] | |
| [String]$Pkcs12String, | |
| [Parameter(Mandatory=$false)] | |
| [ValidateSet("CurrentUser","LocalMachine")] | |
| [String]$CertificateStoreLocation = "LocalMachine", | |
| [Parameter(Mandatory=$false)] | |
| [String]$CertificateStoreName = "My" |
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
| #Requires -RunAsAdministrator | |
| param ( | |
| # ISO Path | |
| [Parameter(Mandatory)] | |
| [ValidateScript({Test-Path $_})] | |
| [String] | |
| $IsoPath, | |
| # Language Pack ISO |
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
| param ( | |
| # Log File Location | |
| [Parameter(Mandatory=$false)] | |
| [ValidateScript({Test-Path $_})] | |
| [string] | |
| $LogFilePath = $env:TEMP, | |
| # Policy ID | |
| [Parameter(Mandatory=$false)] | |
| [string] |
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 New-AzureUniqueName { | |
| param ($prefix,$NameLength = 24) | |
| $length = $prefix.length | |
| if ($length -ge $NameLength) { | |
| throw "Name prefix too long" | |
| } | |
| else { | |
| $fillUnique = ((New-Guid).toString() -replace "-","").Substring(0,($NameLength-$length)) | |
| } |