How to Install XPS Viewer on Windows 11 Using PowerShell

  • Thread Author
In a world where file formats reign supreme, the XPS (XML Paper Specification) format offers a unique alternative to the ubiquitous PDF. Designed by Microsoft, XPS files provide a structured and consistent approach to preserving the layout, fonts, and imagery of documents across various devices. However, if you're a Windows 11 user, you might have already discovered that this seemingly indispensable tool—the XPS Viewer—no longer ships with the latest version of Windows. Fear not, as there’s a quick way to install it using PowerShell!

Why You Need XPS Viewer in Windows 11​

Though XPS may not have taken the world by storm, it remains a reliable option for document sharing without distortion. It's akin to that trusty flashlight you dig out during a power outage—you might not use it every day, but when you need it, it’s a lifesaver. Unfortunately, Windows 11 has relegated the XPS Viewer to "optional feature" status, leaving users to fend for themselves.
This guide will walk you through the steps to install the XPS Viewer using PowerShell. Let’s dive in!

Step 1: Open PowerShell as Administrator​

First things first, to install any system components, administrative rights are essential. Accessing PowerShell as an administrator is straightforward:
  1. Right-click on the Windows Start button.
  2. Select "Windows Terminal (Admin)" or "Windows PowerShell (Admin)" from the context menu.
This gives you the elevated permissions necessary for installation.

Step 2: Install the XPS Viewer​

Now, it's time to put those PowerShell skills to the test. You’ll need to enter a specific command to kick off the XPS Viewer installation. Here’s the command you'll need:
Code:
 Add-WindowsCapability -Online -Name XPS.Viewer~~~~0.0.1.0
Simply copy and paste that command into the PowerShell window and hit Enter. The process might take a few minutes, so be patient while Windows fetches the required files.

Step 3: Confirm the Installation​

After the installation has finished, you might be wondering if everything went smoothly. Checking installation status is just a command away:
Code:
 Get-WindowsCapability -Online | Where-Object {$_.Name -like "XPS"}
If the installation was successful, you should see a status reading "Installed." If not, don’t despair—errors in installation can often be resolved with a quick check of your internet connection or system updates.

Step 4: Run XPS Viewer on Windows 11​

Once the XPS Viewer is installed, you can easily access it:
  • Use the Windows Search box: Simply type "XPS Viewer" and select the application from the search results.
  • Open directly from an XPS file: Double-click any .xps file, and it should launch automatically in XPS Viewer.
Voilà! You’re now ready to view XPS files without hassle.

Tips for Common Issues​

While installing XPS Viewer is typically smooth sailing, you may run into a few bumps along the way. Here are some troubleshooting tips for stubborn installations:
  • Check your internet connection: Since Windows may need to download additional components, a stable connection is a must.
  • Run Windows Update: Ensure your system is up to date, as certain updates might be necessary for the installation of optional features like the XPS Viewer.
  • Restart PowerShell: If all else fails, try restarting PowerShell and retrying the installation command.

Optional: Remove XPS Viewer​

If you find that the XPS Viewer clutters your Start menu or isn’t needed any longer, you can easily uninstall it using the following command:
Code:
 Remove-WindowsCapability -Online -Name XPS.Viewer~~~~0.0.1.0
This command clears the viewer from your system, freeing up some space and tidying your applications.

Conclusion​

Installing the XPS Viewer on Windows 11 may not be as straightforward as it once was, but with these PowerShell commands, you can manage your XPS files with ease. This approach allows you to install and uninstall the viewer conveniently, so you’re not stuck fumbling around with unsupported file types.
So, next time you're sifting through documents and come across an XPS file, you'll know just what to do! Keep these steps handy, and don't hesitate to share your experiences, tips, or questions in the comments below. Happy viewing!

Source: H2S Media Steps to Installing XPS Viewer on Windows 11 Using PowerShell