The Get‑WindowsFeature is a PowerShell cmdlet that retrieves
information about the Windows features and roles that are
installed or available on a Windows Server.
That last part is very important because the cmdlet is part of the
ServerManager module and only available on Windows Server by default.
With this cmdlet administrators are able to manage what Windows
features are installed from the command line.
Note that the Get‑WindowsFeature cmdlet requires the
ServerManager module to be installed.
If the module is not installed,
you can install it by running the command
Install‑WindowsFeature ServerManager first.
And with the ‑ComputerName you can install it on a remote server as well.
All right, I'm kind of jumping around here with all my demos to different tools.
This time I'm on the Windows Server.
The reason I'm on a Windows Server is because we're
running the Get‑WindowsFeature, which can only be ran on a server.
So when I run the cmdlet by itself,
it's pulling back all the different Windows features that are installed,
and it is pulling back everything that is installed and
everything that's available to be installed.
So when I bump this out,
I'm basically saying in this command here that run the
WindowsFeature and I'm going to pipe that into a Where‑Object to
say I only want the True Installed items,
so I want everything that is installed.
Then I'm going to pipe that into an object,
a Select‑Object, and I'm only going to pull the Name and the InstallState,
which should be all installed.
So now let's look at, okay, we have all these features,
how about a feature that's not installed yet?
So when I look at the Get IPAM,
it's going to come back and tell me that's in available state.
Well, that's because it's not installed yet.
So what I can do is I can run an Install‑WindowsFeature with that IPAM,
and now it's going to come back and actually run through
the process of installing that feature.
I'm going to give it a few seconds here,
and when it finishes here in a second,
it's going to pop up a message on the screen saying that it
installed the tool and you're ready to go,
start using it.
And there you have it.
All right, so now that I've installed it, let's show you how to uninstall it.
So I don't really need this IPAM tool on here,
so I'm going to run the Uninstall‑WindowsFeature.
And it's going through, it's showing that it is installed,
so it did do the install last time,
and now it's going through the process of removing it.
Once the removal's done,
it's going to pop up on the screen saying that it
successfully uninstalled the new feature.
And there you have it.
Now with any of these, you can add ‑ComputerName,
just like all the other cmdlets we've talked about with the remotename,
and you can uninstall and install these features across
multiple servers in your network.