Project

PSPublishModule

Build, test, version, sign, and publish PowerShell modules with reusable PowerForge pipelines.

Stars 48
Forks 16
PowerShell Gallery downloads 17,213
Release v3.0.186
Language: C# Updated: 2026-11-04
Command

Install-ModuleScript

Module
PSPublishModule
Inputs
System.Management.Automation.PSObject System.String

Copies only PowerShell scripts from a module's Internals\Scripts folder to a destination path. The destination is flattened (no Module/Version subfolders).

Syntax

Install-ModuleScript
[-Exclude <String[]>]
[-Force]
[-Include <String[]>]
[-ListOnly]
[-Name] <String>
[-OnExists <Merge|Overwrite|Skip|Stop|Refresh>]
[-Path] <String>
[-RequiredVersion <Version>]
[-ScriptsRelativePath <String>]
[-Unblock]
[<CommonParameters>]
#
Parameter set: ByName
Install-ModuleScript
[-Exclude <String[]>]
[-Force]
[-Include <String[]>]
[-ListOnly]
-Module <PSObject>
[-OnExists <Merge|Overwrite|Skip|Stop|Refresh>]
[-Path] <String>
[-RequiredVersion <Version>]
[-ScriptsRelativePath <String>]
[-Unblock]
[<CommonParameters>]
#
Parameter set: ByModule

Examples

Copy PowerShell scripts from Internals\Scripts to a tools folder

Install-ModuleScript -Name EFAdminManager -Path 'C:\Tools' -Verbose

Copies PowerShell script files under Internals\Scripts recursively into C:\Tools, preserving subfolders. Shows each copied file.

Copy only specific scripts, unblocking and overwriting

Install-ModuleScript -Name EFAdminManager -Path 'C:\Tools' -Include 'Repair-*' -Unblock -OnExists Overwrite

Limits to files that start with Repair-, removes Windows Zone.Identifier (on Windows), and overwrites existing files.

Preview planned actions without copying

Get-Module -ListAvailable EFAdminManager | Install-ModuleScript -Path 'C:\Tools' -ListOnly

Shows Source, Destination, and chosen action for each file without writing anything.

Parameters

-Exclude String[] optional
Wildcard exclude filters (relative to the scripts folder).
-Force SwitchParameter optional
Force overwriting read-only files when -OnExists Overwrite or -OnExists Merge with -Force for new-only behavior.
-Include String[] optional
Wildcard include filters (relative to the scripts folder). Defaults to '*.ps1'.
-ListOnly SwitchParameter optional
Show which files would be copied without performing any changes.
-Name String requiredposition: 0pipeline: True (ByPropertyName)sets: ByName
Module name to source scripts from (highest installed version is used by default).
-OnExists OnExistsOption optional
Conflict handling when a destination file already exists. Defaults to Merge (keep existing).
Possible values: Merge, Overwrite, Skip, Stop, Refresh
-Path String requiredposition: 1
Destination folder to copy scripts into (created if missing).
-RequiredVersion Version optional
Optional exact module version to use when multiple versions are installed.
-ScriptsRelativePath String optional
Relative path under the module root where scripts live. Defaults to 'Internals\Scripts'.
-Unblock SwitchParameter optional
When set, attempts to remove the Windows Zone.Identifier (unblock) on copied files.
-Module PSObject requiredpipeline: True (ByValue)sets: ByModule
Specific module instance to source scripts from.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.