This file contains 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 ConvertTo-DSCPullArchive | |
{ | |
<# | |
.Synopsis | |
Converts PowerShell Modules to compressed .zip files. | |
.DESCRIPTION | |
Converts PowerShell Modules to compressed .zip files | |
used by Desired State Configuraiton pull servers. | |
.PARAMETER Source | |
Specifies the source location of a PowerShell module. |
This file contains 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
#Get Net Adapter Names | |
$NetAdapterName = (Get-NetAdapter).Name | |
#Create the External Hyper-V Switch | |
New-VMSwitch -NetAdapterName $NetAdapterName[0] -Name 'External' | |
#Create the Internal Hyper-V Switch | |
New-VMSwitch -SwitchType Internal -Name 'Internal' |
This file contains 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
$Name = 'VyOS' | |
$SwitchName = 'Internal' | |
$HardDiskSize = 2GB | |
$HDPath = 'E:\Hyper-V\Virtual Hard Disks'+'\'+$Name+'.vhdx' | |
$Generation = '1' | |
$ISO_Path = 'D:\ISOs\vyos-1.1.6-amd64.iso' | |
New-VM -Name $Name -SwitchName $SwitchName ` | |
-NewVHDSizeBytes $HardDiskSize ` | |
-NewVHDPath $HDPath -Generation $Generation -MemoryStartupBytes 512MB |
This file contains 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
Register-PSRepository -Name myNuGetSource -SourceLocation 'https://www.myget.org/F/powershellgetdemo/api/v2' -PublishLocation 'https://www.myget.org/F/powershellgetdemo/api/v2/Packages' -InstallationPolicy Trusted |
This file contains 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
Invoke-Command -ComputerName S2 -ScriptBlock {Find-Module xAdcsDeployment,xNetworking,xComputerManagement,xTimeZone | Install-Module -Confirm:$false -Verbose} |
This file contains 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
Invoke-Command -Computername s3 {Get-Childitem Cert:\LocalMachine\My} |
This file contains 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
Configuration DSCLabUp { | |
param ( | |
[string[]]$NodeName, | |
[string]$MachineName | |
) | |
Import-DscResource -ModuleName xActiveDirectory | |
Import-DscResource –ModuleName xPSDesiredStateConfiguration | |
Import-DscResource -Module xNetworking |
This file contains 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
$DNSArray = @('127.0.0.1') | |
$ConfigData = @{ | |
AllNodes = @( | |
@{ | |
Nodename = 'Localhost' | |
Role = "DomainController" | |
MachineName = 'ZDC01' | |
DomainName = "Zephyr.org" |
This file contains 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
Configuration HTTPSPull { | |
param ( | |
[string[]]$NodeName, | |
[string]$MachineName, | |
[string]$IPAddress, | |
[string]$DefaultGateway, | |
[string[]]$DNSIPAddress, | |
[string]$DomaniName | |
) | |