-
Notifications
You must be signed in to change notification settings - Fork 0
/
ninite-install-programs.ps1
27 lines (24 loc) · 1.16 KB
/
ninite-install-programs.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Install Programs with Ninite
#Invoke-WebRequest -Uri https://ninite.com/chrome/ninite.exe -OutFile ninite.exe
Write-Host "Installing Programs..."
New-Item C:\Task\ -type directory 2>&1 | Out-Null
$url = "https://ninite.com/.net4.7-air-chrome-foobar-inkscape-irfanview-java8-klitecodecs-libreoffice-notepadplusplus-paint.net-peazip-qbittorrent-shockwave-silverlight-spotify-steam-vscode/ninite.exe"
$output = "C:\Task\Ninite.exe"
Invoke-WebRequest $url -OutFile $output
Start-Process -FilePath "C:\Task\Ninite.exe" -Wait -Verb runas 2>&1 | Out-Null
# Create A Scheduled Task
Write-Host "Creating A Scheduled Task..."
$taskname = "Ninite"
$descreption = "Update your Apps!"
$action = New-ScheduledTaskAction -Execute "C:\Task\Ninite.exe"
$trigger = New-ScheduledTaskTrigger -Weekly -WeeksInterval 2 -DaysOfWeek Sunday -At 1pm
Register-ScheduledTask -TaskName $taskname -Action $action -Trigger $trigger -Description $descreption 2>&1 | Out-Null
##########
# Restart
##########
Write-Host
Write-Host "Press Any Key To Restart Your System..." -ForegroundColor Black -BackgroundColor White
$host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Delete
Write-Host "Restarting..."
Restart-Computer