Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion Public/OSDCloudDriverPack/OSDCloud.DriverPack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,17 @@ function Get-OSDCloudDriverPacks {
#>
[CmdletBinding()]
param ()
$Results = Import-Clixml -Path "$(Get-OSDModulePath)\cache\driverpack-catalogs\build-driverpacks.xml"
$DriverCatalogXML = Get-PSDrive -PSProvider FileSystem | Where-Object {$_.Name -ne 'C'} | ForEach-Object {
Get-ChildItem "$($_.Root)OSDCloud\Catalogs" -Include "build-driverpacks.xml" -File -Force -Recurse -ErrorAction Ignore
}
if ($DriverCatalogXML) {
foreach ($Item in $DriverCatalogXML) {
Write-Host -ForegroundColor Gray "The default catalog is bypassed; referencing the $($Item.FullName) instead."
$Results = Import-Clixml -Path $Item.FullName
}
} else {
$Results = Import-Clixml -Path "$(Get-OSDModulePath)\cache\driverpack-catalogs\build-driverpacks.xml"
}
$Results
}
function Save-OSDCloudDriverPack {
Expand Down
16 changes: 11 additions & 5 deletions Public/OSDCloudTS/Get-OSDCloudOperatingSystems.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ function Get-OSDCloudOperatingSystems {
[System.String]
$OSArch = 'x64'
)
$FullResults = Get-Content -Path "$(Get-OSDModulePath)\cache\archive-cloudoperatingsystems\CloudOperatingSystems.json" | ConvertFrom-Json
if ($OSArch -eq 'x64'){
$Results = $FullResults | Where-Object {$_.Architecture -eq "x64"}
$OfflineCatalog = Get-PSDrive -PSProvider FileSystem | Where-Object {$_.Name -ne 'C'} | ForEach-Object {
Get-ChildItem "$($_.Root)OSDCloud\Catalogs" -Include "CloudOperatingSystems.json" -File -Force -Recurse -ErrorAction Ignore
}
elseif ($OSArch -eq "arm64"){
$Results = Get-Content -Path "$(Get-OSDModulePath)\cache\archive-cloudoperatingsystems\CloudOperatingSystemsARM64.json" | ConvertFrom-Json
if ($OfflineCatalog) {
foreach ($Item in $OfflineCatalog) {
Write-Host -ForegroundColor Gray "The default catalog is bypassed; referencing the $($Item.FullName) instead."
$FullResults = Get-Content -Path "$($Item.FullName)" | ConvertFrom-Json -ErrorAction "Stop"
}
$Results = $FullResults | Where-Object {$_.Architecture -eq $OSArch}
} else {
$FullResults = Get-Content -Path "$(Get-OSDModulePath)\cache\archive-cloudoperatingsystems\CloudOperatingSystems.json" | ConvertFrom-Json
$Results = $FullResults | Where-Object {$_.Architecture -eq $OSArch}
}
$Results
}
23 changes: 22 additions & 1 deletion Public/OSDCloudTS/Initialize-OSDCloudStartnet.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,28 @@ function Initialize-OSDCloudStartnet {
break
}
}

# PACHED START
if (Test-WebConnection -Uri "google.com") {
Write-Host -ForegroundColor Cyan '[i] Config Post StartNet Scripts'
$Global:ScriptStartNet2 = Get-PSDrive -PSProvider FileSystem | Where-Object { $_.Name -ne 'C' } | ForEach-Object {
Write-Host -ForegroundColor DarkGray "$($_.Root)OSDCloud\Config\Scripts\StartNet2\*.ps1"
Get-ChildItem "$($_.Root)OSDCloud\Config\Scripts\StartNet2\" -Include "*.ps1" -File -Recurse -Force -ErrorAction Ignore
}
if ($Global:ScriptStartNet2) {
$Global:ScriptStartNet2 = $Global:ScriptStartNet2 | Sort-Object -Property FullName
foreach ($Item in $Global:ScriptStartNet2) {
Write-Host -ForegroundColor Gray "Execute $($Item.FullName)"
& "$($Item.FullName)"
}
$TimeSpan = New-TimeSpan -Start $Global:StartnetStart -End (Get-Date)
Write-Host -ForegroundColor DarkGray "$($TimeSpan.ToString("mm':'ss")) Tried to execute Post StartNet Scripts"
}
}
if ($Global:SkipOSDModuleInstall) {
Write-Host -ForegroundColor DarkGray "Skip Installing newer OSD PowerShell Module"
return
}
# PATCHED END
# Check if the OSD Module in the PowerShell Gallery is newer than the installed version
$TimeSpan = New-TimeSpan -Start $Global:StartnetStart -End (Get-Date)
Write-Host -ForegroundColor DarkGray "$($TimeSpan.ToString("mm':'ss")) Updating OSD PowerShell Module"
Expand Down