Install-ChocolateyPowershellCommand

Install-ChocolateyPowershellCommand

Install-ChocolateyPowershellCommand

Installs a PowerShell Script as a command

Syntax

Install-ChocolateyPowershellCommand `
  [-PackageName <String>] `
  -PsFileFullPath <String> `
  [-Url <String>] `
  [-Url64bit <String>] `
  [-Checksum <String>] `
  [-ChecksumType <String>] `
  [-Checksum64 <String>] `
  [-ChecksumType64 <String>] `
  [-Options <Hashtable>] `
  [-IgnoredArguments <Object[]>] [<CommonParameters>]

Description

This will install a PowerShell script as a command on your system. Like an executable can be run from a batch redirect, this will do the same, calling PowerShell with this command and passing your arguments to it. If you include a url, it will first download the PowerShell file.

Notes

Chocolatey works best when the packages contain the software it is managing and doesn’t require downloads. However most software in the Windows world requires redistribution rights and when sharing packages publicly (like on the community feed), maintainers may not have those aforementioned rights. Chocolatey understands how to work with that, hence this function. You are not subject to this limitation with internal packages.

Aliases

None

Examples

EXAMPLE 1


$psFile = Join-Path $(Split-Path -Parent $MyInvocation.MyCommand.Definition) "Install-WindowsImage.ps1"
Install-ChocolateyPowershellCommand -PackageName 'installwindowsimage.powershell' -PSFileFullPath $psFile

EXAMPLE 2


$psFile = Join-Path $(Split-Path -Parent $MyInvocation.MyCommand.Definition) `
 "Install-WindowsImage.ps1"
Install-ChocolateyPowershellCommand `
 -PackageName 'installwindowsimage.powershell' `
 -PSFileFullPath $psFile `
 -PSFileFullPath $psFile `
 -Url 'http://somewhere.com/downloads/Install-WindowsImage.ps1'

EXAMPLE 3


$psFile = Join-Path $(Split-Path -Parent $MyInvocation.MyCommand.Definition) `
 "Install-WindowsImage.ps1"
Install-ChocolateyPowershellCommand `
 -PackageName 'installwindowsimage.powershell' `
 -PSFileFullPath $psFile `
 -Url 'http://somewhere.com/downloads/Install-WindowsImage.ps1' `
 -Url64 'http://somewhere.com/downloads/Install-WindowsImagex64.ps1'

Inputs

None

Outputs

None

Parameters

-PackageName [<String>]

PropertyValue
Aliases
Required?false
Position?1
Default Value
Accept Pipeline Input?false

-PsFileFullPath <String>

PropertyValue
Aliasesfile, fileFullPath
Required?true
Position?2
Default Value
Accept Pipeline Input?false

-Url [<String>]

PropertyValue
Aliases
Required?false
Position?3
Default Value
Accept Pipeline Input?false

-Url64bit [<String>]

PropertyValue
Aliasesurl64
Required?false
Position?4
Default Value
Accept Pipeline Input?false

-Checksum [<String>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

-ChecksumType [<String>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

-Checksum64 [<String>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

-ChecksumType64 [<String>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

-Options [<Hashtable>]

PropertyValue
Aliases
Required?false
Position?named
Default Value@{Headers = @{} }
Accept Pipeline Input?false

-IgnoredArguments [<Object[]>]

PropertyValue
Aliases
Required?false
Position?named
Default Value
Accept Pipeline Input?false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters http://go.microsoft.com/fwlink/p/?LinkID=113216 .

Function Reference

:choco-info: NOTE

This documentation has been automatically generated from Import-Module "$env:ChocolateyInstall\helpers\chocolateyInstaller.psm1" -Force; Get-Help Install-ChocolateyPowershellCommand -Full.

View the source for Install-ChocolateyPowershellCommand