Before Mac refactor

This commit is contained in:
Alex 2021-04-21 15:00:09 +02:00
parent 519343ba51
commit 7499c37bff
2 changed files with 20 additions and 8 deletions

View File

@ -27,7 +27,6 @@ New-VM @vms
Set-VMMemory SRV-01 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
$vmadapter = Get-VMNetworkAdapter -VMName "SRV-01"
Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -StaticMacAddress 00155D027000
# Endregion SRV-01
# RTR-01
@ -68,14 +67,17 @@ $vms = @{
Generation = '2'
MemoryStartupBytes = 1024Mb
VHDPath = "d:\VHD\$VMName.vhdx"
SwitchName = 'Arc-SRV'
SwitchName = 'Bou-LAN'
}
New-VM @vms
Set-VMMemory RTR-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
#Add-VMSwitch -Name "WAN" -ResourcePoolName "WAN"
Add-VMNetworkAdapter -VMName RTR-02 -SwitchName "WAN" -StaticMacAddress 00155D027004
Add-VMNetworkAdapter -VMName RTR-02 -SwitchName "Bou-LAN" -StaticMacAddress 00155D027005
$vmadapter = Get-VMNetworkAdapter -VMName "RTR-01"
Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -StaticMacAddress 00155D027004
Add-VMNetworkAdapter -VMName RTR-02 -SwitchName "WAN" -StaticMacAddress 00155D027005
# RTR-03
@ -92,13 +94,17 @@ $vms = @{
Generation = '2'
MemoryStartupBytes = 1024Mb
VHDPath = "d:\VHD\$VMName.vhdx"
SwitchName = 'WAN'
}
New-VM @vms
Set-VMMemory RTR-03 -DynamicMemoryEnabled $true -MinimumBytes 512MB -StartupBytes 1024MB -MaximumBytes 2GB
Add-VMNetworkAdapter -VMName RTR-03 -SwitchName "Aston" -StaticMacAddress 00155D027006
Add-VMNetworkAdapter -VMName RTR-03 -SwitchName "WAN" -StaticMacAddress 00155D027007
$vmadapter = Get-VMNetworkAdapter -VMName "RTR-01"
Set-VMNetworkAdapter -VMNetworkAdapter $vmadapter[0] -StaticMacAddress 00155D027006
Add-VMNetworkAdapter -VMName RTR-03 -SwitchName "Aston" -StaticMacAddress 00155D027007
Start-VM -Name RTR*

View File

@ -27,3 +27,9 @@ $adapter | New-NetIPAddress `
-DefaultGateway $Gateway
# Configure the DNS client server IP addresses
$adapter | Set-DnsClientServerAddress -ServerAddresses $DNS
Get-VMNetworkAdapter -VMName "Virtual 2008 1" | Where-Object -Property MacAddress -eq "00155D647100" | Rename-VMNetworkAdapter -NewName "vNIC1"
Get-NetAdapter |Where-Object {$_.MacAddress -eq 'XX-XX-XX-XX'} | Select-Object`
-Property Name | Format-Table -HideTableHeaders