InitalCommit
This commit is contained in:
13
ManagmentTools/KickStart_RunUpdates.cmd
Normal file
13
ManagmentTools/KickStart_RunUpdates.cmd
Normal file
@@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
|
||||
REM ###################################################
|
||||
REM # @description: #
|
||||
REM # Opens RunUpdates.ps1 in powershell with #
|
||||
REM # Process ExecutionPolicy set to Unrestricted #
|
||||
REM # #
|
||||
REM # @project: IMGSystTools #
|
||||
REM # @author: Bram Prieshof #
|
||||
REM ###################################################
|
||||
|
||||
echo Starting Update script...
|
||||
PowerShell.exe "Set-ExecutionPolicy -Scope Process Unrestricted -Force; C:\SysTools\ManagmentTools\RunUpdates.ps1"
|
||||
BIN
ManagmentTools/RunUpdates for Apps & System.lnk
Normal file
BIN
ManagmentTools/RunUpdates for Apps & System.lnk
Normal file
Binary file not shown.
28
ManagmentTools/RunUpdates.ps1
Normal file
28
ManagmentTools/RunUpdates.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
######################################################################
|
||||
# @description: #
|
||||
# Used for running updates for Chocolatry apps and Windows Updates #
|
||||
# When the system is all-ready deployed #
|
||||
# #
|
||||
# @project: IMGSystTools #
|
||||
# @author: Bram Prieshof #
|
||||
######################################################################
|
||||
|
||||
if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
|
||||
if ([int](Get-CimInstance -Class Win32_OperatingSystem | Select-Object -ExpandProperty BuildNumber) -ge 6000) {
|
||||
$CommandLine = $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments
|
||||
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList " Set-ExecutionPolicy -Scope Process Unrestricted -Force; $CommandLine"
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output "Checking Chocolatey package updates"
|
||||
choco upgrade -y all
|
||||
Write-Output " Chocolatey updates [OK]"
|
||||
|
||||
Write-Output "Checking Windows updates"
|
||||
Import-Module PSWindowsUpdate
|
||||
Get-WUInstall -MicrosoftUpdate -AcceptAll -Install
|
||||
Write-Output " Windows updates [OK]"
|
||||
|
||||
#Removing Created Shortcuts
|
||||
Remove-Item C:\Users\Public\Desktop\*.lnk
|
||||
Reference in New Issue
Block a user