Various fixes
This commit is contained in:
parent
f3829001d4
commit
61b23e2ef3
1 changed files with 8 additions and 8 deletions
12
cleanW10.ps1
12
cleanW10.ps1
|
@ -106,7 +106,7 @@ function RemoveScheduledTask () {
|
||||||
else { $params.path="" }
|
else { $params.path="" }
|
||||||
try {
|
try {
|
||||||
$task = Invoke-Expression $command
|
$task = Invoke-Expression $command
|
||||||
Write-Host -NoNewline "`tRemove task $($param.name) : "
|
Write-Host -NoNewline "`tRemove task $($params.name) : "
|
||||||
$task | Unregister-ScheduledTask -ErrorAction SilentlyContinue -Confirm:$false
|
$task | Unregister-ScheduledTask -ErrorAction SilentlyContinue -Confirm:$false
|
||||||
Write-Host -ForegroundColor Green "done"
|
Write-Host -ForegroundColor Green "done"
|
||||||
}
|
}
|
||||||
|
@ -248,12 +248,12 @@ function UninstallModernApp {
|
||||||
elseif ( $params.ContainsKey('name') ) {
|
elseif ( $params.ContainsKey('name') ) {
|
||||||
Write-Host -NoNewLine "`tUninstall $($params.name) : "
|
Write-Host -NoNewLine "`tUninstall $($params.name) : "
|
||||||
try {
|
try {
|
||||||
Get-AppxPackage -AllUsers | Where-Object { $_.name -like "*$($params.name)*" } | Out-Null
|
$(Get-AppxPackage -AllUsers | Where-Object { $_.name -like "*$($params.name)*" } | Remove-AppxPackage $pkg)
|
||||||
Write-Host -ForegroundColor Green "done"
|
Write-Host -ForegroundColor Green "done"
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Write-Host -NoNewLine -ForegroundColor Red "`tError `n`t"
|
Write-Host -NoNewLine -ForegroundColor Red "Error `n`t"
|
||||||
write-Host -ForegroundColor DarkRed "Impossible to Uninstall, this app sees to be a system one."
|
write-Host -ForegroundColor DarkRed "Impossible to Uninstall. Is this a system one."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -369,7 +369,7 @@ function KillProcess {
|
||||||
)
|
)
|
||||||
Write-Host -NoNewLine "`tKilling $($params.name) : "
|
Write-Host -NoNewLine "`tKilling $($params.name) : "
|
||||||
try {
|
try {
|
||||||
Stop-Process $(Get-Process $params.name) | Out-Null
|
Stop-Process $(Get-Process $params.name -ErrorAction SilentlyContinue )
|
||||||
Write-Host -ForegroundColor Green "Done"
|
Write-Host -ForegroundColor Green "Done"
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
@ -493,7 +493,7 @@ try {
|
||||||
Remove-PSDrive -Name HKCR
|
Remove-PSDrive -Name HKCR
|
||||||
Remove-PSDrive -Name HKCU
|
Remove-PSDrive -Name HKCU
|
||||||
Remove-PSDrive -Name HKU
|
Remove-PSDrive -Name HKU
|
||||||
reg unload "HKU\Default" | Out-Null
|
reg unload "HKU\Default" 2>&1 | Out-Null
|
||||||
Write-Host -ForegroundColor Green "done"
|
Write-Host -ForegroundColor Green "done"
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
|
|
Reference in a new issue