<# .SYNOPSIS OSDCloud Start Script .DESCRIPTION https://start.bezirk.osdcloud.ch .NOTES Version: 0.1 Creation Date: 05.03.2024 Author: Ákos Bakos Company: SmartCon GmbH Contact: akos.bakos@smartcon.ch Copyright (c) 2024 SmartCon GmbH HISTORY: Date By Comments ---------- --- ---------------------------------------------------------- 05.03.2024 Ákos Bakos Script created 08.03.2024 Ákos Bakos Prevent using OSDPad, due having only one Autopilot profile 20.03.2024 Ákos Bakos Change HTTPS call for HTTP (otherwise [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12) 20.03.2024 Ákos Bakos Change Transport Layer Security (TLS) 1.2 #> #Transport Layer Security (TLS) 1.2 Write-Host -ForegroundColor Green "Transport Layer Security (TLS) 1.2" [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 <# If you need password, please uncomment this part $attempts = 0 $maxAttempts = 3 $correctPassword = "B3z1rkHoefeOSD" while ($attempts -lt $maxAttempts) { # Prompt for password $enteredPassword = Read-Host -Prompt "Enter the password for OSD start" -AsSecureString # Convert the secure string to plain text $Password = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto([System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($enteredPassword)) if ($Password -eq $correctPassword) { # Execute your PowerShell script here Write-Host "Password is correct. Executing PowerShell script..." #Start OSDCloudScriptPad # Write-Host -ForegroundColor Green "Start OSDPad" # Start-OSDPad -RepoOwner SupportSekEinsHoefe -RepoName OSD -RepoFolder Profiles -BrandingTitle 'Sek Eins Hoefe - OS Deployment' -OAuth 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 -Hide Script -Color '#FC4242' Write-Host -ForegroundColor Green "Installing custom OSDCloudLogic Module" Invoke-RestMethod -Uri "http://osdcloudlogic.bezirk.osdcloud.ch" | Invoke-Expression break } else { $attempts++ Write-Host -ForegroundColor Red "Incorrect password. Attempt $attempts of $maxAttempts. Access denied." } } if ($attempts -eq $maxAttempts) { Write-Host -ForegroundColor Red "Maximum number of attempts reached. Access denied." Read-Host -Prompt "Press Enter to exit" } #> Write-Host -ForegroundColor Green "Installing custom OSDCloudLogic Module" Invoke-RestMethod -Uri "http://osdcloudlogic.bezirk.osdcloud.ch" | Invoke-Expression