From bd231b0ce075fe5551560839de13e25a4774ff6d Mon Sep 17 00:00:00 2001 From: Tim Eertmoed Date: Tue, 5 Nov 2024 08:03:39 +0100 Subject: [PATCH] docs/ps/VMs-erstellen.md aktualisiert --- docs/ps/VMs-erstellen.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/docs/ps/VMs-erstellen.md b/docs/ps/VMs-erstellen.md index 4fc0277..dfb35e6 100644 --- a/docs/ps/VMs-erstellen.md +++ b/docs/ps/VMs-erstellen.md @@ -4,6 +4,28 @@ Scirpts: +````ruby +$VMname = 'Client.star.wars' +$VMLocation = "F:\Vm\star.wars\$VMname" +$VHDlocation = 'F:\Vm\star.wars\$VMname' +$Masterplatte = 'F:\Vm\W10Base.vhdx' +$VhdPath = "$VMLocation\$VMname.vhdx" +$startupbytes = 1GB +$VMSwitch = "Internal Network" +$ISOPath = 'F:\Vm\de_windows_10_business_editions_version_2004_updated_oct_2020_x64_dvd_c726ed90.iso' +New-Item -Path "$VMLocation" -ItemType Directory -Force | Out-Null +Set-VMHost -ComputerName Localhost -VirtualHardDiskPath $VHDlocation +Set-VMHost -ComputerName Localhost -VirtualMachinePath $VMLocation +New-VHD -ParentPath $Masterplatte -Path "$VhdPath" -Differencing | Out-Null +new-vm -vmname $VMname -Generation 2 -memorystartupbytes $startupbytes +add-vmharddiskdrive -vmname $VMname -path "$VhdPath" +Get-VMSwitch $VMSwitch | Connect-VMNetworkAdapter -VMName $vmname +Start-VM -VMname $VMname +Get-VM -Name $VMname +```` + + + #### 0. Legen Sie den Namen der VM und die Pfade fest: $VMname = 'Client.star.wars' @@ -14,8 +36,6 @@ $startupbytes = 1GB $VMSwitch = "Internal Network" $ISOPath = 'F:\Vm\de_windows_10_business_editions_version_2004_updated_oct_2020_x64_dvd_c726ed90.iso' - - #### 1. Erstellen Sie ein Verzeichnis für die VM: New-Item -Path "$VMLocation" -ItemType Directory -Force | Out-Null