What is a PowerShell Module?
about Modules – PowerShell
Explains how to install, import, and use PowerShell modules.

Put briefly, a PowerShell module — similar to a Python module — is a way to organize a collection of related code, variables, aliases, etc. in a contained workspace.
There are two types of PowerShell modules:
- Script modules (PowerShell scripts)
- Binary modules (compiled DLLs)
You can intermingle both scripts and compiled DLLs in a single module if the need arises, as there are performance benefits and other enhancements to running compiled code.
Module Loading Paths
If you inspect this PowerShell environment variable, you can see from which folders your PowerShell modules will be loaded.
$env:PSModulePathPSModulePath environment variable
If you install a module from PowerShell Gallery, you can use the Scope parameter to determine which folder in $env:PSModulePath the module will be downloaded.
# Local User
# Install the module to C:\Users\user.name\Documents\WindowsPowerShell\Modules\ on Windows
# Install the module to /home/user.name/.local/share/powershell/Modules on Linux
Install-Module -Name <module-name> -Scope CurrentUser
# Global Module
# Install the module to C:\Program Files\WindowsPowerShell\Modules on Windows
# Install the module to /usr/local/share/powershell/Modules on Linux
Install-Module -Name <module-name>Different ways to install modules from a network repository
Why mention this?
When to Create a Module
- Create a script for a distinct purpose or project
- Additional scripts continue to be added
- Adding helper scripts
- Or, extending the scope of the project
- The project scope continues to grow, we need a place to keep things organized
A PowerShell module — like a function — should be fine-tuned to a specific purpose. In other words, if you see your module becoming too monolithic and trying to be a one-size-fits-all tool, you might consider breaking it up into several individual modules.
Scaffolding the Module
Please note that this is the way that I create PowerShell modules, and should not be construed as the only way to create PS Modules.
Module Directory Structure
ModuleName
|___ModuleName.psd1
|___ModuleName.psm1
|___Private
| |___ps1
| |___Verb-Noun.ps1
| |___Verb-Noun.ps1
|
|___Public |___ps1 |___Verb-Noun.ps1 |___Verb-Noun.ps1ModuleName— Name the module after the project or its intended purposeModuleName.psd1— This is the module manifest, we’ll cover this laterModuleName.psm1— This is your script module, we’ll cover this later as wellPrivate— This is the directory to store your private functions and variables (eg. helper functions)ps1— The PowerShell functions are stored here and are not directly referenced by the userVerb-Noun.ps1— the script file containing the private PowerShell function.
Public— This is directory to store your public functions and variablesps1— The PowerShell function code is stored here and these are the cmdlets the user will be directly runningVerb-Noun.ps1— the script file containing the public PowerShell function
Commands to Create the Module Structure
# Variables
$year = (Get-Date).Year
$moduleName = 'TestModule'
$templateString = 'Test Module'
$version = '1.0'
# Create the "TestModule" top-level directory
New-Item -ItemType Directory -Name $moduleName
# Create subdirectories
# TestModule
# |___ ...
# |___ ...
# |___Private
# | |___ps1
# |___ ...
New-Item -Path "$PWD\$moduleName\Private\ps1" -ItemType Directory -Force
# Create subdirectories
# TestModule
# |___ ...
# |___ ...
# |___ ...
# |___Public
# |___ps1
New-Item -Path "$PWD\$moduleName\Public\ps1" -ItemType Directory -Force
# Create the script module
# TestModule
# |___ ...
# |___ TestModule.psm1
New-Item -Path "$PWD\$moduleName\$moduleName.psm1" -ItemType File
# Create the module manifest
# TestModule
# |___TestModule.psd1
# |___ ...
$moduleManifestParameters = @{ Path = "$PWD\$moduleName\$moduleName.psd1" Author = $templateString CompanyName = $templateString Copyright = "$year $templateString by Benjamin Heater" ModuleVersion = $version Description = $templateString RootModule = "$moduleName.psm1"
}
New-ModuleManifest @moduleManifestParametersInspecting the Manifest
ModuleName
|___ModuleName.psd1
|___ ...
|___ ...The module manifest in relation to the directory structure
Get-Content "$PWD\TestModule\TestModule.psd1"`Output the contents of the moudle manifest
Example Module Manifest
#
# Module manifest for module 'TestModule'
#
# Generated by: Test Module
#
# Generated on: 8/17/2023
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'TestModule.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely identify this module
GUID = '147cfba3-3c6d-4260-aeca-f99aa900cc0c'
# Author of this module
Author = 'Test Module'
# Company or vendor of this module
CompanyName = 'Test Module'
# Copyright statement for this module
Copyright = '2023 Test Module by Benjamin Heater'
# Description of the functionality provided by this module
Description = 'Test Module'
# Minimum version of the Windows PowerShell engine required by this module
# PowerShellVersion = ''
# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# CLRVersion = ''
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = '*'
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = '*'
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = '*'
# DSC resources to export from this module
# DscResourcesToExport = @()
# List of all modules packaged with this module
# ModuleList = @()
# List of all files packaged with this module
# FileList = @()
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. # Tags = @() # A URL to the license for this module. # LicenseUri = '' # A URL to the main website for this project. # ProjectUri = '' # A URL to an icon representing this module. # IconUri = '' # ReleaseNotes of this module # ReleaseNotes = '' } # End of PSData hashtable
} # End of PrivateData hashtable
# HelpInfo URI of this module
# HelpInfoURI = ''
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
}When we ran the New-ModuleManifest command before, PowerShell added our inputs to a .psd1 file with the above template.
The module manifest is responsible for declaring some important things about our module, including:
- The
RootModulescript (eg.TestModule.psm1) - The
GUIDto uniquely identify the module FunctionsToExportfor function names that should be executable by the userCmdletsToExportfor compiled cmdlets that should be executable by the userVariablesToExportfor any module-specific variablesAliasesToExportfor any aliases defined in your functions or cmdlets- And, many more configurations
about Module Manifests – PowerShell
Describes the settings and practices for writing module manifest files.

Inspecting the Script Module
ModuleName
|___ ...
|___ModuleName.psm1
|___ ...The script module in relation to the directory structure
Get-Content "$PWD\TestModule\TestModule.psm1"Output the contents of the script module
Script Module I’ve Created for All My Modules
$directorySeparator = [System.IO.Path]::DirectorySeparatorChar
$moduleName = $PSScriptRoot.Split($directorySeparator)[-1]
$moduleManifest = $PSScriptRoot + $directorySeparator + $moduleName + '.psd1'
$publicFunctionsPath = $PSScriptRoot + $directorySeparator + 'Public' + $directorySeparator + 'ps1'
$privateFunctionsPath = $PSScriptRoot + $directorySeparator + 'Private' + $directorySeparator + 'ps1'
$currentManifest = Test-ModuleManifest $moduleManifest
$aliases = @()
$publicFunctions = Get-ChildItem -Path $publicFunctionsPath | Where-Object {$_.Extension -eq '.ps1'}
$privateFunctions = Get-ChildItem -Path $privateFunctionsPath | Where-Object {$_.Extension -eq '.ps1'}
$publicFunctions | ForEach-Object { . $_.FullName }
$privateFunctions | ForEach-Object { . $_.FullName }
$publicFunctions | ForEach-Object { # Export all of the public functions from this module # The command has already been sourced in above. Query any defined aliases. $alias = Get-Alias -Definition $_.BaseName -ErrorAction SilentlyContinue if ($alias) { $aliases += $alias Export-ModuleMember -Function $_.BaseName -Alias $alias } else { Export-ModuleMember -Function $_.BaseName }
}
$functionsAdded = $publicFunctions | Where-Object {$_.BaseName -notin $currentManifest.ExportedFunctions.Keys}
$functionsRemoved = $currentManifest.ExportedFunctions.Keys | Where-Object {$_ -notin $publicFunctions.BaseName}
$aliasesAdded = $aliases | Where-Object {$_ -notin $currentManifest.ExportedAliases.Keys}
$aliasesRemoved = $currentManifest.ExportedAliases.Keys | Where-Object {$_ -notin $aliases}
if ($functionsAdded -or $functionsRemoved -or $aliasesAdded -or $aliasesRemoved) { try { $updateModuleManifestParams = @{} $updateModuleManifestParams.Add('Path', $moduleManifest) $updateModuleManifestParams.Add('ErrorAction', 'Stop') if ($aliases.Count -gt 0) { $updateModuleManifestParams.Add('AliasesToExport', $aliases) } if ($publicFunctions.Count -gt 0) { $updateModuleManifestParams.Add('FunctionsToExport', $publicFunctions.BaseName) } Update-ModuleManifest @updateModuleManifestParams } catch { $_ | Write-Error }
}I use the script module as an initialization script for when the module is first imported. Looking at the code from top to bottom, I’ll briefly summarize what the script module is doing.
- Dynamically determine the module name using
$PSScriptRoot - Assume the
.psd1file shares the same name as the parent directory
(the.psd1is invoking this.psm1script module) - Pull the current module manifest using
Test-ModuleManifest, in order to compare and update things as necessary - Discover all
.ps1files in private and public directories and source them in - Loop over each public function and determine if any aliases are defined and export them as module members
- Do some comparisons against the current module manifest to see if any functions or aliases have been added or removed, and if so, update the module manifest
You could add additional logic to the .psm1 script module if there are things you’d like your module to do when it’s first imported.
Adding Code to the Module
ModuleName
|___ ...
|___ ...
|___Private <--- May not be referenced by user
| |___ps1 <--- Script files
| |___Verb-Noun.ps1 <--- Private function 1
| |___Verb-Noun.ps1 <--- Private function 2
| |___etc.
|
|___Public <--- May be referenced by user |___ps1 <--- Script files |___Verb-Noun.ps1 <--- Public function 1 |___Verb-Noun.ps1 <--- Public function 2 |___etc.The PowerShell code in relation to the directory structure
The examples here are going to be a bit contrived. The intent — however — is to keep this blog post as concise as possible while still providing clear examples of functionality.
Adding a Private Function
ModuleName
|___ ...
|___ ...
|___Private
| |___ps1
| |___Confirm-CoffeeTime.ps1
| |___ ...
|
|___ ...Private function in relation to the directory structure
function Confirm-CoffeeTime { [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [ValidateSet('Regular', 'Decaf')] [String]$CoffeeType ) begin { $currentDateTime = Get-Date $regularCoffeeHours = 4..20 $decafCoffeeHours = 0..3 + 21..23 } process { if ($CoffeeType -eq 'Regular') { if ($currentDateTime.Hour -in $regularCoffeeHours) { $result = $true } else { $result = $false } } else { if ($currentDateTime.Hour -in $decafCoffeeHours) { $result = $true } else { $result = $false } } } end { if ($result -eq $true) { return "Enjoy your cup of $CoffeeType coffee!" } else { throw "You may not drink $CoffeeType right now!" } }
}Note the function name matches the file name ‘Confirm-CoffeeTime’
Adding a Public Function
ModuleName
|___ ...
|___ ...
|___ ...
|
|___Public |___ps1 |___Get-Coffee.ps1 |___ ...Public function in relation to the directory structure
function Get-Coffee { [CmdletBinding()] param ( [Parameter(Mandatory = $true, Position = 0)] [ValidateSet('Regular', 'Decaf')] [String]$CoffeeType ) begin {} process { try { # Call the private function to confirm coffee time $confirmation = Confirm-CoffeeTime -CoffeeType $CoffeeType Write-Host $confirmation -ForegroundColor Green } catch { throw $_ } } end {}
}Note the function name matches the file name ‘Get-Coffee’
Importing and Using the Module
What we should expect to happen:
- Import the module
- Run
Get-Command -Module <module_name> - Observe that we have only one user-executable command
Import-Module .\TestModuleImporting our test module
Get-Command -Module TestModuleSee which commands are provided by the module


Perfect! Our public Get-Coffee function is performing as expected — calling the private Confirm-CoffeeTime function and returning stdout or stderr.
Applying this to Real Projects
As mentioned before, the examples above are contrived, and not great at demonstrating how a PowerShell module could be used for real projects. Some examples of how you might create a PowerShell module:
- API clients
- CTF tools
- Hacking tools
- Forensic tools
- Diagnostic tools
- Etc.
Don’t create more work for yourself!
Creating a duplicate PowerShell module as a learning experience is absolutely fine. However, if there’s a module on GitHub or the PS Gallery that meets your needs, use that and consider contributing to the source code if it’s open source.
If you see an existing module, but aren’t satisfied with it for any reason, that would absolutely be a perfect opportunity to create your own solution.
Some Modules I’ve Written
GitHub – 0xBEN/PSProxmox: PowerShell module for interfacing with Proxmox API
PowerShell module for interfacing with Proxmox API – GitHub – 0xBEN/PSProxmox: PowerShell module for interfacing with Proxmox API
Good reference for my usage of public/private functions
GitHub – 0xBEN/PSToolbox: PowerShell module containing a set of generally useful tools.
PowerShell module containing a set of generally useful tools. – GitHub – 0xBEN/PSToolbox: PowerShell module containing a set of generally useful tools.
No usage of private functions, just bundling tools
Wrapping Up
I want to emphasize that this post is a demonstration of the way that I create PowerShell modules. It is not the only way to create PowerShell modules.
That said, I do hope that I gave you some ideas on how to get started with creating your own modules, and how you can keep your related code organized.
Here’s a quick fix if you see the modules installed in the system, but the commands don’t work.
Step 1: Run the get module command and and copy the locations (can be 2 or more)
Get-Module -ListAvailable
$Env:PSModulePath
[Environment]::GetEnvironmentVariable("PSModulePath")Step 3: If the location(s) in Step 1 are missing in the output of Step 2, then add the locations using the below script:
#Save the current value in the $p variable.
$p = [Environment]::GetEnvironmentVariable("PSModulePath")
#Add the new path to the $p variable. Begin with a semi-colon separator.
$p += ";C:Program Files (x86)MyCompanyModules" ## Update path here
#Add the paths in $p to the PSModulePath value.
[Environment]::SetEnvironmentVariable("PSModulePath",$p)Step 4: Reboot the system and check if the path has been added.
To check if all paths are up-to-date and being used by PowerShell, run the below script and any missing paths will be reported in Red Colour (Green outputs are good)
# Step 1: Get all available modules and their directory paths
$modules = Get-Module -ListAvailable | Select-Object Name, ModuleBase
# Step 2: Get the list of directories in $env:PSModulePath
$modulePaths = $env:PSModulePath -split ";" # Splitting the paths
$missingPaths = @()
foreach ($module in $modules) { # Extract the parent directory path until "Modules" $moduleParentPath = Split-Path $module.ModuleBase -Parent # Ensure $moduleParentPath is not empty to avoid the error while ($moduleParentPath -and (Split-Path $moduleParentPath -Leaf) -ne 'Modules') { $moduleParentPath = Split-Path $moduleParentPath -Parent } # Check if the parent directory is present in $env:PSModulePath if ($moduleParentPath -and -not ($modulePaths -contains $moduleParentPath)) { Write-Host "$($module.Name) module directory ($($module.ModuleBase)) is missing from $env:PSModulePath." -ForegroundColor Red # Add the missing path to the list if not already present if (-not ($missingPaths -contains $moduleParentPath)) { $missingPaths += $moduleParentPath } }
}
# If there are missing paths, prompt the user to fix
if ($missingPaths.Count -gt 0) { $action = Read-Host "There are missing paths. Do you want to 'Fix' or 'Ignore'?" if ($action -eq 'Fix') { foreach ($path in $missingPaths) { $env:PSModulePath += ";$path" } Write-Host "Paths added to $env:PSModulePath for this session." -ForegroundColor Green } elseif ($action -eq 'Ignore') { Write-Host "Ignoring missing paths." -ForegroundColor Yellow } else { Write-Host "Invalid choice. Exiting without action." -ForegroundColor Yellow }
} else { Write-Host "All module paths are up to date." -ForegroundColor Green
}And don’t forget to keep your modules updated: Remove Old PowerShell Modules (arnav.au)
Q: How do you install a PowerShell module?
A: You can install a PowerShell module using the Install-Module cmdlet. For example: Install-Module -Name <ModuleName>.
Q: What is the difference between Windows PowerShell and PowerShell Core?
A: Windows PowerShell is built on the .NET Framework and is exclusive to Windows. PowerShell Core, often simply called “PowerShell”, is built on .NET Core and is cross-platform, meaning it can run on Windows, Linux, and macOS.
Q: How can I find available modules in the PowerShell Gallery?
A: You can use the Find-Module cmdlet to search for modules in the PowerShell Gallery.
Q: What are cmdlets in PowerShell?
A: Cmdlets are lightweight commands that are used in the Windows PowerShell environment. They are specialized .NET classes.
Q: How can I import a PowerShell module that I’ve installed?
Q: How do I check if a specific module is installed?
A: You can use the Get-Module -ListAvailable -Name <ModuleName> command to check if a specific module is installed.
Q: Can I install PowerShell on operating systems other than Windows?
A: Yes, PowerShell Core is cross-platform and can be installed on Linux and macOS in addition to Windows.
Q: I’m using Windows Server 2008 R2, can I install the latest version of PowerShell?
A: Windows Server 2008 R2 originally came with Windows PowerShell 2.0. You can upgrade to newer versions, but the highest supported version for Windows Server 2008 R2 is Windows PowerShell 5.1.
Q: Is there a difference between cmdlet and command in PowerShell?
A: In PowerShell, a cmdlet is a single-function command that manipulates objects in the shell. On the other hand, a command can refer to both cmdlets and other command-line utilities available in the operating system.
Q: How do I set permissions in PowerShell for executing scripts?
A: You can set the execution policy in PowerShell using the Set-ExecutionPolicy cmdlet. For example, Set-ExecutionPolicy RemoteSigned allows you to run scripts that you’ve written and scripts from trusted publishers.
Q: What is the purpose of the -Name parameter in many PowerShell cmdlets?
A: The -Name parameter typically specifies the name of an object, like a module or service, that you want to interact with using the cmdlet.
Q: How can I verify the version of my PowerShell installation?
A: You can use the $PSVersionTable.PSVersion command in PowerShell to check the version.
Q: Is PowerShell available for non-Windows operating systems?
A: Yes, PowerShell Core is a cross-platform version that’s available for Windows, Linux, and macOS.
Q: Can I run PowerShell scripts on Windows 7 or Windows Server 2008?
A: Yes, both Windows 7 and Windows Server 2008 support Windows PowerShell. However, you might need to update to a newer version to access all features.
Q: What is the significance of the PSModulePath environment variable in PowerShell?
Q: If I encounter an error like “operable program or batch file not found”, what might be the issue?
A: Such an error often indicates that the command you’re trying to run isn’t recognized, either because it’s not installed, the spelling is incorrect, or its path isn’t included in the system’s PATH environment variable.
Q: How do I specify which user account should run a PowerShell script?
Q: What are the differences between the parameters AllUsers and CurrentUser in PowerShell?
Q: What does the repository parameter usually indicate in a PowerShell cmdlet?
A: The repository parameter typically refers to a location or source where modules, packages, or other data can be fetched. For example, the PowerShell Gallery is a default repository for many modules.
Q: How can I create a new folder using PowerShell?
A: You can use the New-Item cmdlet with the -type parameter set to “directory”. For example: New-Item -Path C:example -Name "NewFolder" -Type Directory.
Q: What is the significance of the -name parameter in PowerShell?
A: The -name parameter is used to specify the name of an item, be it a module, file, folder, or other entities in PowerShell. It helps to define or identify the target or source item for various cmdlets.
Q: How is the automation capability of PowerShell?
keywords: install the module in microsoft OS active directory want to install powershell modules
1. PSReadLine
This one is an easy first call for me. I could write an entire article on just this module, and my team would make me trim it down because it’s too long. PSReadLine is the ultimate tool to get the most value out of PowerShell. The module adds several features that just make everything easier. You have the history it can pull up to cut down on the time spent typing.

You can use it to open inline help, which takes you to the help documentation and even to the section of the command you are working on without needing to step out of your session.

Then, I pressed F1 to open the help menu.

It can also utilize AI predictors for modules you are currently using, making recommendations specific to larger modules to help you get results more quickly. The best current example of this is the Azure feedback provider, which helps sift through the thousands of commands to get what you need very fast. There is so much to this one; I recommend you check out the PSReadLine 2.2 GA article by Jason Helmick for a quick look into all it can do.
2. dbatools
If you are looking to become an expert on keeping your databases clean, this module is so robust that there’s a dbatools book on how to get the most out of it.
3. PowerShellAI

Some people may use it to research commands and as an aid to get the most out of those commands, but those who know its true value use it for mundane trivia.
But that’s not all it can do. You also can use DALL-E if the need for a random AI image arises. The value here is too great to measure.
Get-DalleImage "Velociraptor doing the macarena"

Bonus: Image2Text
There’s no better way to highlight this than by combining the DALL-E image from the PowerShellAI module with this module. I saved myself a thousand words here.
$Image = Get-DalleImage "Kitten kungfu fighting an alligator"
New-Image2Text -ImagePath $Image -OutputTxtPath C:\temp\kitten.txt

I have never struggled to write a blog this much. There are thousands of modules, and picking a favorite is not easy. Then I have limited space to do the write-up for each, and it feels inadequate. I do know that if you have ever thought to yourself, “I wish PowerShell could do X,” you are not the first to think it, and someone likely has built a module to help you out.
I interview people from the PowerShell community every week on The PowerShell Podcast, and one question I always ask is, “What are your three favorite modules?” You always get a few duplicates over the years, but every guest has at least one that is new to me. You should spend some time in the module world if you’re looking to get the most out of PowerShell.

Jordan had spent his life wondering why tasks he didn’t like to do had no options to complete themselves. Eventually he had to make that happen on his own. It turned out that he enjoyed making tasks complete themselves, and PDQ thought that is something he should talk about on the internet.
Modules
Module management for PowerShell Universal.
The Modules page provides information about the modules installed in the system.
You can view and search the modules accessible by PowerShell Universal by visiting the Platform \ Modules page. Searching provides a wildcard result of the modules found in each of the environments defined within PowerShell Universal.
Install Modules from the Gallery
Modules can be installed from the PowerShell Gallery. To search for a module, you can change the drop down next to the search box from Local to PowerShell Gallery. Searches conducted will run against the Gallery rather than locally.
Once a module is found, you’ll be able to click the Install button to save it locally. Modules installed in this method will be installed into the Repository directory under Modules.
PowerShell Universal integrates with the PackageManagement v3 module and will automatically pick up on registered package sources. For example, you can register a package source with the command below.
Once the source has been registered, it will be shown within the drop down on the modules page.
You can also create modules directly in PowerShell Universal. These modules will be created in the Repository directory under Modules.
These modules will be available in all environments.
To create a new module navigate to Platform \ Modules and click Create New Module. Define the module name and version.
Once created, the module will be listed under Universal Modules with the option to edit properties and content as well as delete the module.
When editing the module, it will open a code editor where you can define functions, variables and aliases to export.
Modules with Universal Resources
Modules can contain PowerShell Universal resources such as scripts, APIs and apps. Adding these modules to your environment will automatically add these resources to your PowerShell Universal instance. These resources will be read-only within the environment. To remove them, you will have to remove the module.
Click the download button on the left size of the module to install it. Once installed, read-only resources will be added to your environment.
You can also save modules directly to the PowerShell Universal repository folder.
Below is an example of the layout of a Universal module. If the module contains the .universal folder, resources will be loaded from it automatically.
Resources cannot use paths and must use the module and command name to associate resources with their respective scripts.
For example, the above scripts.ps1 file would have to be written such as this.
Within PSUModule.psm1, you would need to define the Start-MyScript function. This is the function that will be called when running the script.
Manually Install Modules
PowerShell Universal will add the repository’s Modules directory to the $ENV:PSModulePath for all environments. Adding modules to this directory will ensure the module is available to any PowerShell process running with PowerShell Universal.
This section includes information about certain modules and their use within PowerShell Universal.
Windows Server 2019 and above
Update the ActiveDirectory module to version 1.0.1.0 which has PowerShell Core support
Windows Server 2016 and below
Choose from 1 of 2 available workarounds:
Include the
-SkipEditionCheckparameter with Import-Module when importing the ActiveDirectory moduleUse the Windows PowerShell 5.1 environment instead of Integrated/PowerShell Core




