From 1af8968c96d622c65412fcbd562f959599585a49 Mon Sep 17 00:00:00 2001 From: Jaromir Kaspar Date: Wed, 24 Feb 2021 18:44:54 +0100 Subject: [PATCH 1/2] added sort of packages --- Tools/PatchParentDisks.ps1 | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Tools/PatchParentDisks.ps1 b/Tools/PatchParentDisks.ps1 index 1ba54d4a..aa710681 100644 --- a/Tools/PatchParentDisks.ps1 +++ b/Tools/PatchParentDisks.ps1 @@ -71,6 +71,13 @@ If (-not $isAdmin) { }else{ WriteErrorAndExit "No update package selected, exitting" } + + #sort packages by size (to apply Servicing Stack Update first) + if ($msupackages.Filenames){ + $files=@() + foreach ($Filename in $msupackages.FileNames){$files+=Get-ChildItem -Path $filename} + $packages=($files |Sort-Object -Property Length).Fullname + } #endregion # region mount and patch VHD @@ -80,8 +87,8 @@ If (-not $isAdmin) { #Grab letter $DriveLetter=(Get-Disk -Number $Mount.Number |Get-Partition | Where-Object Driveletter).DriveLetter #Patch - foreach ($msupackage in $msupackages){ - Add-WindowsPackage -PackagePath $msupackage.filename -Path "$($DriveLetter):\" + foreach ($package in $packages){ + Add-WindowsPackage -PackagePath $package -Path "$($DriveLetter):\" } #Dismount $Mount | Dismount-VHD From 119ba60ff2cd53a28d5d292e18240855ebf96d90 Mon Sep 17 00:00:00 2001 From: Jaromir Kaspar Date: Thu, 25 Feb 2021 11:12:14 +0100 Subject: [PATCH 2/2] WSLab -> MSLab rebrand --- Scripts/1_Prereq.ps1 | 12 ++++++------ Scripts/2_CreateParentDisks.ps1 | 12 ++++++------ Scripts/3_Deploy.ps1 | 12 ++++++------ Scripts/LabConfig.ps1 | 14 +++++++------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Scripts/1_Prereq.ps1 b/Scripts/1_Prereq.ps1 index a0e34592..8a4ed194 100644 --- a/Scripts/1_Prereq.ps1 +++ b/Scripts/1_Prereq.ps1 @@ -30,7 +30,7 @@ function Get-WindowsBuildNumber { Start-Transcript -Path "$PSScriptRoot\Prereq.log" $StartDateTime = Get-Date WriteInfo "Script started at $StartDateTime" - WriteInfo "`nWSLab Version $wslabVersion" + WriteInfo "`nMSLab Version $mslabVersion" #Load LabConfig.... . "$PSScriptRoot\LabConfig.ps1" @@ -59,7 +59,7 @@ function Get-WindowsBuildNumber { # Check if not running in root folder if (($psscriptroot).Length -eq 3) { - WriteErrorAndExit "`t WSLab canot run in root folder. Please put WSLab scripts into a folder. Exiting" + WriteErrorAndExit "`t MSLab canot run in root folder. Please put MSLab scripts into a folder. Exiting" } # Checking for Compatible OS @@ -90,7 +90,7 @@ function Get-WindowsBuildNumber { WriteSuccess "`t $Filename is present, skipping download" }else{ $FileContent=$null - $FileContent = (Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/Microsoft/WSLab/master/Tools/$Filename.ps1").Content + $FileContent = (Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/Microsoft/MSLab/master/Tools/$Filename.ps1").Content if ($FileContent){ $script = New-Item $Path -type File -Force $FileContent=$FileContent -replace "PasswordGoesHere",$LabConfig.AdminPassword #only applies to 1_SQL_Install and 3_SCVMM_Install.ps1 @@ -109,7 +109,7 @@ function Get-WindowsBuildNumber { WriteSuccess "`t $Filename is present, skipping download" }else{ $FileContent = $null - $FileContent = (Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/Microsoft/WSLab/master/Tools/$Filename.ps1").Content + $FileContent = (Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/Microsoft/MSLab/master/Tools/$Filename.ps1").Content if ($FileContent){ $script = New-Item $Path -type File -Force $FileContent=$FileContent -replace "PasswordGoesHere",$LabConfig.AdminPassword @@ -128,7 +128,7 @@ function Get-WindowsBuildNumber { WriteSuccess "`t $Filename is present, skipping download" }else{ $FileContent = $null - $FileContent = (Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/Microsoft/WSLab/master/Tools/$FileName.ps1").Content + $FileContent = (Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/Microsoft/MSLab/master/Tools/$FileName.ps1").Content if ($FileContent){ $script = New-Item "$PSScriptRoot\ParentDisks\$FileName.ps1" -type File -Force Set-Content -path $script -value $FileContent @@ -145,7 +145,7 @@ If ( Test-Path -Path "$PSScriptRoot\Temp\Convert-WindowsImage.ps1" ) { }else{ WriteInfo "`t Downloading Convert-WindowsImage" try { - Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/microsoft/WSLab/master/Tools/Convert-WindowsImage.ps1" -OutFile "$PSScriptRoot\Temp\Convert-WindowsImage.ps1" + Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/microsoft/MSLab/master/Tools/Convert-WindowsImage.ps1" -OutFile "$PSScriptRoot\Temp\Convert-WindowsImage.ps1" } catch { WriteError "`t Failed to download Convert-WindowsImage.ps1!" } diff --git a/Scripts/2_CreateParentDisks.ps1 b/Scripts/2_CreateParentDisks.ps1 index 1d69305d..f032cc16 100644 --- a/Scripts/2_CreateParentDisks.ps1 +++ b/Scripts/2_CreateParentDisks.ps1 @@ -95,7 +95,7 @@ If (-not $isAdmin) { Start-Transcript -Path "$PSScriptRoot\CreateParentDisks.log" $StartDateTime = Get-Date WriteInfo "Script started at $StartDateTime" - WriteInfo "`nWSLab Version $wslabVersion" + WriteInfo "`nMSLab Version $mslabVersion" #Load LabConfig.... . "$PSScriptRoot\LabConfig.ps1" @@ -166,7 +166,7 @@ If (-not $isAdmin) { #Check if not running in root folder if (($PSScriptRoot).Length -eq 3) { - WriteErrorAndExit "`t WSLab canot run in root folder. Please put WSLab scripts into a folder. Exiting" + WriteErrorAndExit "`t MSLab canot run in root folder. Please put MSLab scripts into a folder. Exiting" } #check Hyper-V @@ -245,8 +245,8 @@ If (-not $isAdmin) { WriteInfoHighlighted "Checking if volume filesystem is NTFS or ReFS" $driveletter=$PSScriptRoot -split ":" | Select-Object -First 1 if ($PSScriptRoot -like "c:\ClusterStorage*"){ - WriteSuccess "`t Volume Cluster Shared Volume. Mountdir will be $env:Temp\WSLAbMountdir" - $mountdir="$env:Temp\WSLAbMountdir" + WriteSuccess "`t Volume Cluster Shared Volume. Mountdir will be $env:Temp\MSLabMountdir" + $mountdir="$env:Temp\MSLabMountdir" $VolumeFileSystem="CSVFS" }else{ $mountdir="$PSScriptRoot\Temp\MountDir" @@ -595,8 +595,8 @@ If (-not $isAdmin) { if ($VMVersion.Build -ge 17763){ $oeminformation=@" - WSLab - https://aka.ms/wslab + MSLab + https://aka.ms/mslab "@ }else{ diff --git a/Scripts/3_Deploy.ps1 b/Scripts/3_Deploy.ps1 index d3fb46a5..dd2507cd 100644 --- a/Scripts/3_Deploy.ps1 +++ b/Scripts/3_Deploy.ps1 @@ -589,8 +589,8 @@ If (-not $isAdmin) { if ($VMVersion.Build -ge 17763){ $oeminformation=@" - WSLab - https://aka.ms/wslab + MSLab + https://aka.ms/mslab "@ }else{ @@ -674,7 +674,7 @@ If (-not $isAdmin) { $StartDateTime = Get-Date WriteInfoHighlighted "Script started at $StartDateTime" - WriteInfo "`nWSLab Version $wslabVersion" + WriteInfo "`nMSLab Version $mslabVersion" ##Load LabConfig.... @@ -765,7 +765,7 @@ If (-not $isAdmin) { # Checking if not running in root folder if (($PSScriptRoot).Length -eq 3) { - WriteErrorAndExit "`t WSLab canot run in root folder. Please put WSLab scripts into a folder. Exiting" + WriteErrorAndExit "`t MSLab canot run in root folder. Please put MSLab scripts into a folder. Exiting" } # Checking for Compatible OS @@ -872,8 +872,8 @@ If (-not $isAdmin) { WriteInfoHighlighted "Checking if volume filesystem is NTFS or ReFS" $driveletter=$PSScriptRoot -split ":" | Select-Object -First 1 if ($PSScriptRoot -like "c:\ClusterStorage*"){ - WriteSuccess "`t Volume Cluster Shared Volume. Mountdir will be $env:Temp\WSLAbMountdir" - $mountdir="$env:Temp\WSLAbMountDir" + WriteSuccess "`t Volume Cluster Shared Volume. Mountdir will be $env:Temp\MSLabMountdir" + $mountdir="$env:Temp\MSLabMountDir" $VolumeFileSystem="CSVFS" }else{ $mountdir="$PSScriptRoot\Temp\MountDir" diff --git a/Scripts/LabConfig.ps1 b/Scripts/LabConfig.ps1 index c1b06c66..90fbcbc9 100644 --- a/Scripts/LabConfig.ps1 +++ b/Scripts/LabConfig.ps1 @@ -1,6 +1,6 @@ -#basic config for Windows Server 2019, that creates VMs for S2D Hyperconverged scenario https://github.com/Microsoft/WSLab/tree/master/Scenarios/S2D%20Hyperconverged +#basic config for Windows Server 2019, that creates VMs for S2D Hyperconverged scenario https://github.com/Microsoft/MSLab/tree/master/Scenarios/S2D%20Hyperconverged -$LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'WSLab-' ; DCEdition='4'; Internet=$true ; AdditionalNetworksConfig=@(); VMs=@()} +$LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'MSLab-' ; DCEdition='4'; Internet=$true ; AdditionalNetworksConfig=@(); VMs=@()} # Windows Server 2019 1..4 | ForEach-Object {$VMNames="S2D"; $LABConfig.VMs += @{ VMName = "$VMNames$_" ; Configuration = 'S2D' ; ParentVHD = 'Win2019Core_G2.vhdx'; SSDNumber = 0; SSDSize=800GB ; HDDNumber = 12; HDDSize= 4TB ; MemoryStartupBytes= 512MB }} # Or Azure Stack HCI @@ -18,7 +18,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'W $LabConfig=@{ DomainAdminName='LabAdmin'; # Used during 2_CreateParentDisks (no affect if changed after this step) AdminPassword='LS1setup!'; # Used during 2_CreateParentDisks. If changed after, it will break the functionality of 3_Deploy.ps1 - Prefix = 'WSLab-'; # (Optional) All VMs and vSwitch are created with this prefix, so you can identify the lab. If not specified, Lab folder name is used + Prefix = 'MSLab-'; # (Optional) All VMs and vSwitch are created with this prefix, so you can identify the lab. If not specified, Lab folder name is used SwitchName = 'LabSwitch'; # (Optional) Name of vSwitch SecureBoot=$true; # (Optional) Useful when testing unsigned builds (Useful for MS developers for daily builds) DCEdition='4'; # 4 for DataCenter or 3 for DataCenterCore @@ -39,7 +39,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'W DHCPscope="10.0.0.0"; # (Optional) 10.0.0.0 is configured if nothing is specified. Scope has to end with .0 (like 10.10.10.0). It's always /24 DCVMVersion="9.0"; # (Optional) Latest is used if nothing is specified. Make sure you use values like "8.0","8.3","9.0" TelemetryLevel=""; # (Optional) If configured, script will stop prompting you for telemetry. Values are "None","Basic","Full" - TelemetryNickname=""; # (Optional) If configured, telemetry will be sent with NickName to correlate data to specified NickName. So when leaderboards will be published, WSLab users will be able to see their own stats + TelemetryNickname=""; # (Optional) If configured, telemetry will be sent with NickName to correlate data to specified NickName. So when leaderboards will be published, MSLab users will be able to see their own stats AutoStartAfterDeploy=$false; # (Optional) If $false, no VM will be started; if $true or 'All' all lab VMs will be started after Deploy script; if 'DeployedOnly' only newly created VMs will be started. InternetVLAN=""; # (Optional) If set, it will apply VLAN on Interent adapter connected to DC AdditionalNetworksConfig=@(); # Just empty array for config below @@ -181,11 +181,11 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'W TelemetryLevel (optional) Example: TelemetryLevel="Full" If set, scripts will not prompt for telemetry. Can be "None","Basic","Full" - For more info see https://aka.ms/wslab/telemetry + For more info see https://aka.ms/mslab/telemetry TelemetryNickname (optional) Example: TelemetryNickname="Jaromirk" - If configured, telemetry will be sent with NickName to correlate data to specified NickName. So when leaderboards will be published, WSLab users will be able to see their own stats + If configured, telemetry will be sent with NickName to correlate data to specified NickName. So when leaderboards will be published, MSLab users will be able to see their own stats #> #endregion @@ -278,7 +278,7 @@ $LabConfig=@{ DomainAdminName='LabAdmin'; AdminPassword='LS1setup!'; Prefix = 'W VMProcessorCount (Optional) Example VMProcessorCount=8 Number of Processors in VM. If specified more than available in host, maximum possible number will be used. - If "Max" is specified, maximum number of VCPUs will be used (determined from host where wslab is running) + If "Max" is specified, maximum number of VCPUs will be used (determined from host where mslab is running) Generation (Optional) Example Generation=1