Details on the mandatory integrity mechanism can be found at Windows Vista Integrity Mechanism Technical Reference
Cmdlets included with this module are;
- Get-IntegrityLabel: Gets an instance of
BaseObjectLabel
for the resource specified - Remove-IntegrityLabel: Removes the mandatory integrity label set on an object
- Set-IntegrityLabel: Adds or changes the mandatory integrity label set on an object
The Get-IntegrityLabel
cmdlet outputs an instance of BaseObjectLabel
which
can be used as an input to Remove-IntegrityLabel
or Set-IntegrityLabel
.
This object can also be used separately from the other cmdlets to manage the
integrity level label of an object if that is preferred. The docs for this
class can be found at Docs/BaseObjectLabel.
These cmdlets have the following requirements
- PowerShell v3.0 or newer
- Windows PowerShell (not PowerShell Core)
- Windows Server 2008 R2/Windows 7 or newer
The easiest way to install this module is through PowerShellGet. This is installed by default with PowerShell 5 but can be added on PowerShell 3 or 4 by installing the MSI here.
Once installed, you can install this module by running;
# Install for all users
Install-Module -Name PSIntegrity
# Install for only the current user
Install-Module -Name PSIntegrity -Scope CurrentUser
If you wish to remove the module, just run
Uninstall-Module -Name PSIntegrity
.
If you cannot use PowerShellGet, you can still install the module manually, here are some basic steps on how to do this;
- Download the latext zip from GitHub here
- Extract the zip
- Copy the folder
PSIntegrity
inside the zip to a path that is set in$env:PSModulePath
. By default this could beC:\Program Files\WindowsPowerShell\Modules
orC:\Users\<user>\Documents\WindowsPowerShell\Modules
- Reopen PowerShell and unblock the downloaded files with
$path = (Get-Module -Name PSPrivilege -ListAvailable).ModuleBase; Unblock-File -Path $path\*.psd1;
- Reopen PowerShell one more time and you can start using the cmdlets
Note: You are not limited to installing the module to those example paths, you can add a new entry to the environment variable PSModulePath
if you want to use another path.
Contributing is quite easy, fork this repo and submit a pull request with the
changes. To test out your changes locally you can just run .\build.ps1
in
PowerShell. This script will ensure all dependencies are installed before
running the test suite.
Note: this requires PowerShellGet or WMF 5 to be installed
- Add support for different types of objects like services, registry keys