# Install-ModuleScript

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

Project

PSPublishModule

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

[View on GitHub](https://github.com/EvotecIT/PSPublishModule) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSPublishModule/releases/tag/v3.0.124) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSPublishModule/2.0.27)

Stars **48**

Forks **15**

Open issues **1**

PowerShell Gallery downloads **17,213**

Release **v3.0.195**

Language: C# Updated: 2026-11-25

Command 

**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>]
```

[#](#method-install-modulescript-string-switchparameter-string-switchparameter-string-onexistsoption-string-version-string-switchparameter)

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>]
```

[#](#method-install-modulescript-string-switchparameter-string-switchparameter-psobject-onexistsoption-string-version-string-switchparameter)

Parameter set: `ByModule`

## Examples

### Copy PowerShell scripts from Internals\Scripts to a tools folder

```powershell
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

```powershell
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

```powershell
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](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_commonparameters).

Evotec API Reference Copyright 2026 Evotec Services

<!-- PowerForge markdown artifact sha256:4C6B182D6E0F0D811C922EE970F96D23813543665F0FBDC914029B1BFC82D051 -->
