API Reference
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).
Remarks
Copies only PowerShell scripts from a module's Internals\Scripts folder to a destination path. The destination is flattened (no Module/Version subfolders).
Examples
Copy PowerShell scripts from Internals\Scripts to a tools folder
PS>
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
PS>
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
PS>
Get-Module -ListAvailable EFAdminManager | Install-ModuleScript -Path 'C:\Tools' -ListOnly
Shows Source, Destination, and chosen action for each file without writing anything.
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.
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>]#ByNameParameters
- Exclude String[]
- Wildcard exclude filters (relative to the scripts folder).
- Force SwitchParameter
- Force overwriting read-only files when -OnExists Overwrite or -OnExists Merge with -Force for new-only behavior.
- Include String[]
- Wildcard include filters (relative to the scripts folder). Defaults to '*.ps1'.
- ListOnly SwitchParameter
- Show which files would be copied without performing any changes.
- Name String
- Module name to source scripts from (highest installed version is used by default).
- OnExists OnExistsOption
- Conflict handling when a destination file already exists. Defaults to Merge (keep existing).
- Possible values:
Merge,Overwrite,Skip,Stop,Refresh - Path String
- Destination folder to copy scripts into (created if missing).
- RequiredVersion Version
- Optional exact module version to use when multiple versions are installed.
- ScriptsRelativePath String
- Relative path under the module root where scripts live. Defaults to 'Internals\Scripts'.
- Unblock SwitchParameter
- When set, attempts to remove the Windows Zone.Identifier (unblock) on copied files.
Install-ModuleScript [-Exclude <String[]>] [-Force] [-Include <String[]>] [-ListOnly] -Module <PSObject> [-OnExists <Merge|Overwrite|Skip|Stop|Refresh>] -Path <String> [-RequiredVersion <Version>] [-ScriptsRelativePath <String>] [-Unblock] [<CommonParameters>]#ByModuleParameters
- Exclude String[]
- Wildcard exclude filters (relative to the scripts folder).
- Force SwitchParameter
- Force overwriting read-only files when -OnExists Overwrite or -OnExists Merge with -Force for new-only behavior.
- Include String[]
- Wildcard include filters (relative to the scripts folder). Defaults to '*.ps1'.
- ListOnly SwitchParameter
- Show which files would be copied without performing any changes.
- Module PSObject
- Specific module instance to source scripts from.
- OnExists OnExistsOption
- Conflict handling when a destination file already exists. Defaults to Merge (keep existing).
- Possible values:
Merge,Overwrite,Skip,Stop,Refresh - Path String
- Destination folder to copy scripts into (created if missing).
- RequiredVersion Version
- Optional exact module version to use when multiple versions are installed.
- ScriptsRelativePath String
- Relative path under the module root where scripts live. Defaults to 'Internals\Scripts'.
- Unblock SwitchParameter
- When set, attempts to remove the Windows Zone.Identifier (unblock) on copied files.