WizardKit/.bin/Scripts/dism.ps1
Alan Mason 3031df5a4c 2016-07: Retroactive Updates
* DISM
  * Much safer WinVer check

* Enter / Exit SafeMode
  * Now enables MSI (un)installers in SafeMode w/ Networking

* Final Checklist
  * NEW: can now be run directly from UFD

* Hide Windows 10 Upgrade.reg
  * Added more registry blocks

* Removed Chocolately
  * Too much volatility
  * Ninite will regain default installer status

* Replaced ConEmu with Cmder
  * Cmder has a heavily modified ConEmu
  * Changed background
  * Added Cmder launchers in Misc

* SW Diagnostics
  * NEW: can now be run directly from UFD
  * BleachBit / Winapp2.ini updated
    * Expanded selections
    * Now only checks temp data size; DOES NOT delete temp data
  * Internet connection test will now loop until the manually exited
  * Now warns you that it can't check Windows activation in SafeMode

* Bugfixes
  * reset_browsers.ps1
    * Should skip "resetting" the backup folders (i.e. Default.wkbak)
2017-11-17 00:50:54 -07:00

31 lines
No EOL
922 B
PowerShell

# WK-DISM wrapper
## Init ##
$wd = $(Split-Path $MyInvocation.MyCommand.Path)
pushd "$wd"
. .\init.ps1
clear
$host.UI.RawUI.WindowTitle = "WK DISM wrapper"
$logpath = "$WKPath\Info\$date"
md "$logpath" 2>&1 | out-null
$log = "$logpath\DISM.log"
$bin = (Get-Item $wd).Parent.FullName
# OS Check
. .\os_check.ps1
if ($win_version -notmatch '^8|10$') {
wk-error "This tool is not intended for $os_name."
} else {
# Get mode
$modes = @(
@{Name="Check Health"; Command="/CheckHealth"}
@{Name="Restore Health"; Command="/Online /Cleanup-Image /RestoreHealth"}
)
$selection = (menu-select "WK DISM Wrapper" "Please select action to perform" $modes)
$command = "DISM {0}" -f $modes[$selection - 1].Command
sleep -s 1
start "DISM" -argumentlist @("/Online", "/Cleanup-Image", "$command", "/LogPath:$log") -NoNewWindow -Wait -RunAs
}
# Done
pause "Press any key to exit..."