LogoLogo
OSDeploy.comTwitterGitHubPowerShell Gallery
  • OSD PowerShell Module
  • Functions
  • Docs
    • OSDCloud
    • OSDPad
    • OSDHelp
      • Autopilot
    • Guides
      • UEFI System Firmware Update
      • In Your Code
      • New-OSDBoot.usb
      • Partitions
        • New-OSDDisk (Information)
        • New-OSDDiskWinPE (GPT)
        • New-OSDDiskWinPE (2 Disks)
        • AutoUnattend.xml
    • OSDWindowsImage
    • Windows Setup Environment
      • Execution Policy
      • WinSE Settings
      • Import Modules
      • Automation
    • Release Notes
    • Trash
      • Adk
        • Edit-ADKwinpe.wim
        • Get-ADKpaths
        • New-ADK.iso
        • New-ADKcopype
      • Appx
      • Block
      • CloudDriver
      • Dell
        • Get-DellCatalogPC
        • Get-MyDellBIOS
        • Update-MyDellBios
      • Disk
        • Backup-Disk.ffu
        • Clear-LocalDisk
        • Clear-USBDisk
        • Get-LocalDisk
        • Get-OSDDisk
        • Get-USBDisk
        • New-OSDisk
          • Old Version
            • Sandbox
            • Partition Layout
            • Partition Sizes
            • Volume Labels
            • AutoUnattend.xml
        • Get-USBVolume
      • Dism
        • Get-MyWindowsCapability
        • Get-MyWindowsPackage
        • Set-WimExecutionPolicy
        • Set-WindowsImageExecutionPolicy
      • Display
        • Get-VidConRes
      • Driver
        • Get-OSDDriverWmiQ
        • Get-OSDDriver
      • General
        • Get-OSD
        • Get-OSDClass
        • Get-OSDGather
        • Get-OSDPower
        • Get-RegCurrentVersion
        • Get-SessionsXml
        • Save-OSDDownload
      • MyBitLocker
        • Get-MyBitLockerKeyProtectors
        • Backup-MyBitLocker
        • Save-MyBitLockerExternalKey
        • Save-MyBitLockerKeyPackage
        • Save-MyBitLockerRecoveryPassword
        • Unlock-MyBitLockerExternalKey
      • OOBE
      • PSModule
        • Copy-PSModuleToFolder
        • Copy-PSModuleToWim
        • Copy-PSModuleToWindowsImage
      • WebConnection
      • WebPSScript
      • WinPEWim
      • WinPE
        • Enable-PEWimPSGallery
        • Get-OSDWinPE
Powered by GitBook
On this page
  • -Name
  • -Destination
  • -RemoveOldVersions
  • Versioning
  • Version Subfolders

Was this helpful?

  1. Docs
  2. Trash
  3. PSModule

Copy-PSModuleToFolder

OSD 21.2.9.2+

Copy-PSModuleToFolder used to copy an installed PowerShell Module to separate destination directory. The destination directory will be created if it does not exist

PS C:\> Get-Help Copy-PSModuleToFolder -Full

NAME
    Copy-PSModuleToFolder
    
SYNOPSIS
    Get-Module and copy the ModuleBase to a new Destination\ModuleBase
    
    
SYNTAX
    Copy-PSModuleToFolder [-Name] <String[]> [-Destination] <String> [-RemoveOldVersions] [<CommonParameters>]
    
    
DESCRIPTION
    Get-Module and copy the ModuleBase to a new Destination\ModuleBase
    

PARAMETERS
    -Name <String[]>
        Name of the PowerShell Module to Copy
        
        Required?                    true
        Position?                    1
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  true
        
    -Destination <String>
        Destination PSModule directory
        Copied Module is a Child of Destination
        
        Required?                    true
        Position?                    2
        Default value                
        Accept pipeline input?       true (ByPropertyName)
        Accept wildcard characters?  false
        
    -RemoveOldVersions [<SwitchParameter>]
        Removes older Module Versions from the Destination
        
        Required?                    false
        Position?                    named
        Default value                False
        Accept pipeline input?       false
        Accept wildcard characters?  false
        
    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see 
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). 
    
INPUTS
    
OUTPUTS
    
NOTES
    
    
        21.1.30.1   Initial Release
        21.1.30.2   Added WinPE Parameter
        21.1.30.3   Renamed PSModulePath Parameter to Destination, Added RemoveOldVersions
        21.1.31.1   Removed WinPE Parameter
        21.2.2.1	Renamed to Copy-ModuleToFolder so I don't mess with PowerShellGet
        21.2.9.1	Renamed to Copy-PSModuleToFolder to standardize
    
    
RELATED LINKS
    https://osd.osdeploy.com/module/functions/psmodule/copy-psmoduletofolder

-Name

#String
-Name PShot

#Array of Strings
-Name PShot,OSD,OSDBuilder

#Wildcard
-Name OSD*

#Position 0
Copy-Module PShot

-Destination

#Module will be copied to T:\Temp\PShot\<ModuleVersion>
Copy-Module -Name PShot -Destination T:\Temp

#Module will be copied to C:\Program Files\WindowsPowerShell\Modules\OSD\<ModuleVersion>
Copy-Module -Name OSD -Destination "C:\Program Files\WindowsPowerShell\Modules"

-RemoveOldVersions

-RemoveOldVersions [<SwitchParameter>]
    Removes older Module Versions from the Destination
    
    Required?                    false
    Position?                    named
    Default value                False
    Accept pipeline input?       false
    Accept wildcard characters?  false

Versioning

If multiple versions of a Module exist, only the latest will be copied

Version Subfolders

Version Subfolders are retained by Copy-Module, unless the -WinPE or -RemoveOldVersionsparameters are used

PreviousPSModuleNextCopy-PSModuleToWim

Last updated 4 years ago

Was this helpful?

-RemoveOldVersions:$true
-RemoveOldVersions:$false