10 Windows PowerShell commands you need to be using (2024)

Key Takeaways

  • PowerShell can back up drivers & integrate them into a Windows ISO for easy reinstalls.
  • It's simpler to manage RSAT tools & manage servers with one PowerShell command.
  • Use PowerShell to remove bloatware from Windows, trim down features, & save space.

One of Windows 11's most powerful features is Microsoft PowerShell, a task-based command-line tool that is also great for scripting automation tasks. It replaces the old Command Prompt and makes it easy to add, change, or delete Windows components. If you've seen it mentioned but wondered what type of commands to try, we've rounded up ten of our favorites to get you going.

Related

What is Windows PowerShell, and why would you use it?

The average Windows user probably doesn't need to use PowerShell, but it's nice to know what it is if you do need it.

10 To back up device drivers

And to integrate them into your installation ISO for easy reinstalls

10 Windows PowerShell commands you need to be using (2)

PowerShell is great for handling complex automation tasks, and when talking about Windows, one of the most annoying parts is having to download and reinstall every device driver if you have to reinstall the operating system. However, with PowerShell, with a few commands, you can back up the already-installed drivers on your PC and then slipstream them into a Windows ISO. That gives you everything you need to reinstall your system at any given time, without having to worry if the drivers you need are in Windows Update or not.

The command you need for exporting your drivers is below, and you will need to run PowerShell with administrator privileges to get it to run.

Export-WindowsDriver -Online -Destination "full path of the backup folder" 

Of course, you'll need to replace the text in quotes with the path where you want to back up the drivers.

Then, with an up-to-date Windows ISO from UUP dump, you can mount the install.wim file, and add all the drivers into your Windows installation ISO. That way, when you next need to install your system, everything you need will be already in the installation files. It's a very short process to save a ton of time on your next installation.

Related

How to back up drivers and integrate them in a Windows ISO

A full driver backup is always a good idea to protect your setup, and in this guide, we'll show you how.

Sometimes it's just simpler to use the CLI

10 Windows PowerShell commands you need to be using (4)

Server admins have a wealth of tools at their disposal on Windows 11, but some aren't installed by default. Remote Server Administration Tools, or RSAT, is a suite of features that make managing servers remotely easier, which is critical for keeping business operations running. If you're a server admin, the easiest way to get these tools into your Windows 11 Pro installation is with PowerShell, as one command gets you every tool at once.

Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability -Online

Once installed, that gives you a whole toolkit for managing Active Directory functions, DHCP servers, BitLocker, Group Policy, and more. The best part is that you won't have to log in to each of your servers to manage them anymore, which saves a ton of time.

1:30

Related

How to install RSAT in Windows 11

Remote Server Administration Tools (RSAT) are essential for Windows administrators. Here's how to install them on Windows 11.

8 To remove bloat

Give Windows a little trim with some quick commands

Whether it's unwanted apps installed in Windows, or bloatware added by your computer's manufacturer, our devices have a problem. Even the best laptops come with a handful of apps or programs we either don't need or don't want, and it's time to claw back some storage space from the bloat. Whether it's features like Copilot that you know you won't use or preinstalled apps that are tricky to remove because PowerShell is deeply integrated into Windows, you can remove them from the command line.

To do this, download Win11Debloat from GitHub (use the Code > Download ZIP option at the top). Technically, this is a PowerShell script instead of a command, but once you extract the download and launch the Run.bat file, it'll open up a simple interface inside a PowerShell window which will let you remove most of the bloat from Windows 11 with a few button presses.

Related

Tired of Windows 11 being filled with junk? Here's how to remove it

Unnecessary junk can slow down your Windows 11 PC, but it already comes with a lot of it out of the box. Here's how to remove it.

1

7 To disable Hyper-V virtualization

10 Windows PowerShell commands you need to be using (8)

Being able to run virtualization on Windows is great, allowing you to create and run virtual machines so you can switch between operating systems without having to play with boot settings. But, sometimes Hyper-V, Microsoft's hypervisor that enables virtualization tasks, can cause issues or slowdowns with the rest of your installation. If that's the case, you'll want a quick way to turn it off without having to uninstall and lose all the settings that you've been tinkering with. Opening up Microsoft PowerShell and putting the following string into the command prompt will stop Hyper-V from starting when your computer boots.

bcdedit /set hypervisorlaunchtype off

After you reboot your computer, Hyper-V will no longer be running, and you can troubleshoot to see if the slowdowns and other unwanted behaviors are caused by the hypervisor or by something else. If you find the issue isn't Hyper-V related, you can turn it back on easily by changing the off to an on and rerunning the command.

Related

How to disable Hyper-V in Windows 11

You might want to disable Hyper-V if you encounter performance issues in other hypervisors. Here's how to do so on a Windows 11 machine.

2

6 To fix issues with the taskbar

10 Windows PowerShell commands you need to be using (10)

Windows 11 gives you some level of control over the taskbar, including where icons show up and if it auto-hides when not in use, so you can use every pixel of your display. Sometimes, this feature glitches and requires the taskbar to be re-registered with Windows so that it will work again. The quickest way to do that is in PowerShell, with the following command.

Get-AppXPackage -AllUsers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register “$($_.InstallLocation)AppXManifest.xml”} 

Once the command has run, you shouldn't have to do anything else to get your taskbar behaving properly again.

Related

Prefer a cleaner desktop? Here’s how to fix the Windows taskbar when it won't auto-hide.

If your Windows taskbar isn't behaving, here's how to get it back to the way you prefer

2

5 To enter your BIOS

10 Windows PowerShell commands you need to be using (12)

Image: chiphell.com (Chinese)

The BIOS or UEFI that runs on any personal computer is the first thing that boots when you turn on the power. It's also where you want to be able to boot into for low-level changes to your system configuration, but sometimes it's hard to know how to do so. While most devices running Windows have a button that you can press at boot to enter the BIOS, some devices lock you out and prefer you to reboot into BIOS from your Windows desktop.

shutdown /r /fw

This command will reboot your computer and into the BIOS, so you can change the settings you need. It's often quicker to do this than any other method, including the long-winded method where you hold Shift on your keyboard while clicking on Restart in the power menu. That way, it takes a few more mouse clicks before you're near the BIOS, and there's something elegant about using the command line.

Related

How to enter the BIOS on Windows 10 or 11

The BIOS is where you can change some of the more advanced settings on your PC - thankfully, it's much easier to access than it used to be

4 For managing user accounts

10 Windows PowerShell commands you need to be using (14)

PowerShell is a powerful administration tool, and one common task it is used for is managing user accounts. It's by far the easiest way to delete users from your computer who are no longer using it, but be warned that this method doesn't give you any warning prompts before it deletes the user. The following command in a PowerShell window will delete the user while still keeping their files safe in the Users folder.

Remove-LocalUser -Name "USERNAME"

Once run, the user will no longer be able to log in to your computer, keeping it safe. It might not be a use that most users will need, but it does show that PowerShell can be used for a wide variety of tasks.

2:05

Related

How to delete a user account on Windows 11

If you no longer need a specific user account on your PC, Windows 11 gives you plenty of ways to delete it and make things simpler.

3 To find out your laptop's battery health

Why this isn't a Windows widget we will never know

While Windows gives you many tools to monitor your laptop's performance with nice graphical interfaces, one thing it hides away is your battery's health report. The battery indicator in the taskbar has rough estimates for usage, but it also falls short in telling you important information like number of charge cycles, estimates on capacity, and any historical usage data. The good news is that a short command can generate an in-depth report on your battery health, so you can stay informed.

powercfg /batteryreport /output "C:\battery_report.html"

Running this command in a Windows PowerShell window with administrator privileges will generate a report in HTML form on the root of your C: drive. Open that report in any web browser, and you'll get information about your battery's capacity, the manufacturer, and things like cycle count, recent battery use statistics, and data on how long you used your laptop on battery each week. That way, you know if your battery is due replacement, or if something else is draining its battery life each day.

Technically speaking, this also works in the standard Command Prompt, but it's a useful shortcut all the same.

Related

How to create a battery report on Windows 11 to learn more about it

Creating a battery report in Windows 11 is a great way to learn how well your laptop's battery is doing. Here's how to do it.

2 To remove preinstalled apps and services

10 Windows PowerShell commands you need to be using (17)

Sometimes you might want to remove preinstalled apps that are still fairly useful, like the Xbox app. Maybe you don't want the user to be able to easily sign up for Game Pass for PC, or you just don't want the app trying to run every boot. PowerShell is often used for tasks like this, and once you know the package name, it's trivial to remove the app without having to find it in the installed apps list. The other thing to note is that if other uninstall methods aren't working properly, the PowerShell command should still work.

get-appxpackage -allusers *xboxapp* | remove-appxpackage 

You can also extend the PowerShell command to stop the user from reinstalling the same package from the Microsoft Store.

get-appxprovisionedpackage –online | where-object {$_.packagename –like “*xboxapp*”} | remove-appxprovisionedpackage –onlinedsda

That string removes the Xbox app and stops it from showing up for reinstallation. While you're de-Xboxing your computer, you might want to disable the Xbox Game Bar at the same time, if you find it's more of an annoyance than anything else. It is the easiest way to take HDR screenshots on Windows 11, though, so you might want to hold off.

Related

How to remove the Xbox app in Windows 11

Is the Xbox app causing you problems? Here's how you can uninstall it.

1 For managing Windows packages

10 Windows PowerShell commands you need to be using (19)

If you're used to the package manager system on Linux and want the same level of command-line control on Windows, you're in luck. Microsoft now has a first-party tool to do so, Windows Package Manager. You can use Winget inside PowerShell windows to search for packages you want to install and then to download and install, just like any package manager you might have used previously. It's a powerful way to find specific packages that you might struggle to find as installer files from a web search.

winget search <your-app-here> 

Then to install:

winget install <your-app-here> 

It's great for developers who need a specific version of apps to test against, or if you find the Microsoft Store laggy and annoying to browse. Again, this command also works in Command Prompt, but PowerShell looks a bit better when displaying this information.

Related

How to use Windows Package Manager (winget) on Windows 11

Windows Package Manager gives you an easier way to install and manage your apps on WIndows 11 and 10. Here's how to use it.

Microsoft PowerShell can be incredibly powerful with the right commands

The low-level access that PowerShell provides can be a powerful tool, but it's important to know what commands you're running before you start. Because it doesn't hand-hold or ask for confirmation of tasks, it's easy to make an unintended change and be left with a difficult troubleshooting task to revert things to how they were. Once you know how the commands work, you can build out automated scripts to handle complex tasks with ease.

10 Windows PowerShell commands you need to be using (2024)

References

Top Articles
CS:GO Case Opening Sites: A Comprehensive Guide
How CSGO Gambling is Influencing Game Design on Popular Gaming Platforms - Aegisthegame
Frederick County Craigslist
Le Blanc Los Cabos - Los Cabos – Le Blanc Spa Resort Adults-Only All Inclusive
Blairsville Online Yard Sale
DL1678 (DAL1678) Delta Historial y rastreo de vuelos - FlightAware
Wild Smile Stapleton
The Idol - watch tv show streaming online
T&G Pallet Liquidation
What Was D-Day Weegy
CSC error CS0006: Metadata file 'SonarAnalyzer.dll' could not be found
Find The Eagle Hunter High To The East
Brenna Percy Reddit
Raid Guides - Hardstuck
Edible Arrangements Keller
Craigslist Boats For Sale Seattle
Slope Tyrones Unblocked Games
Les Rainwater Auto Sales
Illinois VIN Check and Lookup
Ubg98.Github.io Unblocked
Persona 5 Royal Fusion Calculator (Fusion list with guide)
Self-Service ATMs: Accessibility, Limits, & Features
Laveen Modern Dentistry And Orthodontics Laveen Village Az
Minnick Funeral Home West Point Nebraska
Silky Jet Water Flosser
Cornedbeefapproved
Cor Triatriatum: Background, Pathophysiology, Epidemiology
Is Henry Dicarlo Leaving Ktla
2004 Honda Odyssey Firing Order
Taylored Services Hardeeville Sc
1964 Impala For Sale Craigslist
Marlene2295
Revelry Room Seattle
Street Fighter 6 Nexus
The Ultimate Guide to Obtaining Bark in Conan Exiles: Tips and Tricks for the Best Results
Stolen Touches Neva Altaj Read Online Free
Lowell Car Accident Lawyer Kiley Law Group
Amici Pizza Los Alamitos
Hair Love Salon Bradley Beach
Raisya Crow on LinkedIn: Breckie Hill Shower Video viral Cucumber Leaks VIDEO Click to watch full…
Mid America Irish Dance Voy
Powerboat P1 Unveils 2024 P1 Offshore And Class 1 Race Calendar
Online-Reservierungen - Booqable Vermietungssoftware
Backpage New York | massage in New York, New York
Premiumbukkake Tour
Yosemite Sam Hood Ornament
Who uses the Fandom Wiki anymore?
Minecraft Enchantment Calculator - calculattor.com
Morgan State University Receives $20.9 Million NIH/NIMHD Grant to Expand Groundbreaking Research on Urban Health Disparities
Invitation Quinceanera Espanol
Stone Eater Bike Park
Latest Posts
Article information

Author: Kareem Mueller DO

Last Updated:

Views: 5669

Rating: 4.6 / 5 (46 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Kareem Mueller DO

Birthday: 1997-01-04

Address: Apt. 156 12935 Runolfsdottir Mission, Greenfort, MN 74384-6749

Phone: +16704982844747

Job: Corporate Administration Planner

Hobby: Mountain biking, Jewelry making, Stone skipping, Lacemaking, Knife making, Scrapbooking, Letterboxing

Introduction: My name is Kareem Mueller DO, I am a vivacious, super, thoughtful, excited, handsome, beautiful, combative person who loves writing and wants to share my knowledge and understanding with you.