Copy items in current directory of install.ps1 to PowerShell Module path "$env:userProfile\documents\WindowsPowerShell\Modules".
- Include install.bat and install.ps1 to your module respository.
- Clone PowerShell Module Repository of yours.
- Goto clone path in your local computer and execute install.bat
- all the items in clone repository will be copy to "$env:userProfile\documents\WindowsPowerShell\Modules" as same as direcotry structure of repository.
install.bat execute command as below. If you not yet execute Set-ExecutionPolicy then run install.bat as admin,
PowerShell -Command {Set-Executionpolicy RemoteSigned}
PowerShell .\Install.ps1
Here's cmdlet included in install.ps1
You can specify $modulepath if demand, default is "$env:userProfile\documents\WindowsPowerShell\Modules".
Copy-Module
Get-OperatingSystemVersion
New-ModulePath
Test-ModulePath
Returns Win32_OperatingSystem.Version property.
Get-OperatingSystemVersion
Test "$env:userProfile\documents\WindowsPowerShell\Modules" is exist or not. This Cmdlet will only work with Windows 8 / Windows Server 2012 and later. (It requires Operation System Version for 6, means Windows 8 = PowerShell 3.0 and later) It will returns bool for result.
Test-ModulePath [-modulepath] <string> [<CommonParameters>]
Create Module path if not exist.
New-ModulePath [-modulepath] <string> [<CommonParameters>]
Copy items to module path "$env:userProfile\documents\WindowsPowerShell\Modules".
Copy-Module [-path] <string> [-destination] <string> [<CommonParameters>]