Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
.Removes dell\lenovobloat from a fresh Windows build
.DESCRIPTION
.Removes Dell Bloat
.Removes Lenovo Bloat
#>
############################################################################################################
# Initial Setup #
$exitCode = 0
if (![System.Environment]::Is64BitProcess)
{
# start new PowerShell as x64 bit process, wait for it and gather exit code and standard error output
$sysNativePowerShell = "$($PSHOME.ToLower().Replace("syswow64", "sysnative"))\powershell.exe"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $sysNativePowerShell
$pinfo.Arguments = "-ex bypass -file `"$PSCommandPath`""
$pinfo.RedirectStandardError = $true
#remove dell bloatware
$remediationscript =@"
REM UNINSTALL SCRIPT-----------------------------------------------------------------------------------------------------
REM If you are looking to add applications to this list, search the registry for the string that is listed in the Programs and Features menu until you find the "UninstallString"
REM These usually can be found in:
REM HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\ and then the SID\Product folders.
REM HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
REM HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall
REM There may be multiple uninstall strings for the same application, add all of them here. As the dell applications are updated over time, the applicationID can change.
@tsfahmed2
tsfahmed2 / ifeofix.ps1
Created April 27, 2022 14:45
ifeofix.ps1
Get-ChildItem “HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options” -ea SilentlyContinue | Where {if ($_.Property -contains “Debugger”){($_|Get-ItemProperty).Debugger -like “*PreventStart*”}} | Remove-Item -Force -Recurse;
Get-ChildItem “HKLM:\SOFTWARE\Microsoft\WOW6432Node\Windows NT\CurrentVersion\Image File Execution Options” -ea SilentlyContinue | Where {if ($_.Property -contains “Debugger”){($_|Get-ItemProperty).Debugger -like “*PreventStart*”}} | Remove-Item -Force -Recurse;
#by me
#for XXXXXX
#create scheduled task to install zscaler on logon
#copy the zscaler install to a local directory.
$ErrorActionPreference = "SilentlyContinue"
Copy-Item "$PSScriptRoot\zscaler-install.ps1" -Destination $env:TEMP -Force
# register script as scheduled task
$TriggerStartup = New-ScheduledTaskTrigger -AtLogOn
$STPrin = New-ScheduledTaskPrincipal -UserId "SYSTEM" -RunLevel Highest -LogonType ServiceAccount
$CustomPath = "$env:TEMP\zscaler-install.ps1"
<#
Install Zscaler
By me for XXXXX,
#>
Function Set-RegistryKey
{
[CmdletBinding()]
Param (
[Parameter(Mandatory = $True, HelpMessage = "Please Enter Registry Item Path", Position = 1)]
# Download latest release from github
$Repo = "https://api.github.com/repos/microsoft/winget-cli/releases/latest"
# --- Query the API to get the url of the zip
$APIResponse = Invoke-RestMethod -Method Get -Uri $Repo
$FileUrl = $APIResponse.assets.browser_download_url | where {$_ -match ".msixbundle"}
# --- Download the file to the current location
$fileName = "$($APIResponse.name.Replace(" ","_")).msixbundle"
$exitCode = 0
if (![System.Environment]::Is64BitProcess)
{
# start new PowerShell as x64 bit process, wait for it and gather exit code and standard error output
$sysNativePowerShell = "$($PSHOME.ToLower().Replace("syswow64", "sysnative"))\powershell.exe"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
@tsfahmed2
tsfahmed2 / boxtools
Created May 28, 2020 20:34
Uninstall per-user box tools and install box tools from SYSTEM account.
$exitCode = 0
if (![System.Environment]::Is64BitProcess)
{
# start new PowerShell as x64 bit process, wait for it and gather exit code and standard error output
$sysNativePowerShell = "$($PSHOME.ToLower().Replace("syswow64", "sysnative"))\powershell.exe"
$pinfo = New-Object System.Diagnostics.ProcessStartInfo
$pinfo.FileName = $sysNativePowerShell
@tsfahmed2
tsfahmed2 / okta-deactiveordeleteuser
Created June 11, 2019 17:34
okta deactivateordeleteuser
<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.150
Created on: 6/08/2019 6:08 PM
Created by: tausifkhan
Organization: FICO
Filename:
===========================================================================
.DESCRIPTION