Update setupScriptInfo.ps1

This commit is contained in:
2023-10-10 14:30:33 +00:00
parent 4fda6d9caa
commit 0bf3830c97

View File

@@ -148,6 +148,14 @@ choco install audacity -y
choco install scratch -y
choco install mblock -y
Expand-Archive -Path (Join-Path $tmpPath "Simulation Domotique.zip") -DestinationPath $env:ProgramFiles -Force
$sourceFolderPath = Join-Path $env:ProgramFiles "simulation"
$destinationFolderPath = Join-Path $env:ProgramFiles "Simulation Domotique"
if (Test-Path -Path $sourceFolderPath -PathType Container) {
if (Test-Path -Path $destinationFolderPath -PathType Container) {
Remove-Item -Path $destinationFolderPath -Recurse -Force
}
Rename-Item -Path $sourceFolderPath -NewName "Simulation Domotique"
}
$targetExePath = "C:\Program Files\Simulation Domotique\simulation.exe"
$shortcutPath = (Join-Path $env:PUBLIC "Desktop\Simulation Domotique.lnk")
$shell = New-Object -ComObject WScript.Shell
@@ -170,7 +178,7 @@ $shortcut.WorkingDirectory = (Get-Item $targetExePath).DirectoryName
$shortcut.Save()
# URL shortcut
Disable-WindowsOptionalFeature -online -FeatureName internet-explorer-optional-amd64
Disable-WindowsOptionalFeature -online -NoRestart -FeatureName internet-explorer-optional-amd64
$wshShell = New-Object -ComObject "WScript.Shell"
$urlShortcut = $wshShell.CreateShortcut((Join-Path $env:PUBLIC "Desktop\Office 365.url"))
$urlShortcut.TargetPath = "https://office.com/"
@@ -188,5 +196,5 @@ $urlShortcut.Save()
# Update Windows
Install-Module -Name PSWindowsUpdate -Force
Get-WindowsUpdate -Force
Get-WindowsUpdate -ForceInstall
Install-WindowsUpdate -AcceptAll -AutoReboot