< Back

Add-PoshGitToProfile

Sat Jan 18, 2020 7:51 pm

NAME Add-PoshGitToProfile



SYNOPSIS

Configures your PowerShell profile (startup) script to import the posh-git

module when PowerShell starts.





SYNTAX

Add-PoshGitToProfile [-AllHosts] [-AllUsers] [-Force] [-StartSshAgent] [[-TestParams] <PSObject[]>] [-WhatIf]

[-Confirm] [<CommonParameters>]





DESCRIPTION

Checks if your PowerShell profile script is not already importing posh-git

and if not, adds a command to import the posh-git module. This will cause

PowerShell to load posh-git whenever PowerShell starts.





PARAMETERS

-AllHosts [<SwitchParameter>]

By default, this command modifies the CurrentUserCurrentHost profile

script. By specifying the AllHosts switch, the command updates the

CurrentUserAllHosts profile (or AllUsersAllHosts, given -AllUsers).



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-AllUsers [<SwitchParameter>]

By default, this command modifies the CurrentUserCurrentHost profile

script. By specifying the AllUsers switch, the command updates the

AllUsersCurrentHost profile (or AllUsersAllHosts, given -AllHosts).

Requires elevated permissions.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]

Do not check if the specified profile script is already importing

posh-git. Just add Import-Module posh-git command.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-StartSshAgent [<SwitchParameter>]

Also add `Start-SshAgent -Quiet` to the specified profile script.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-TestParams <PSObject[]>



Required? false

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

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

None.





OUTPUTS

None.





-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Add-PoshGitToProfile



Updates your profile script for the current PowerShell host to import the

posh-git module when the current PowerShell host starts.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Add-PoshGitToProfile -AllHosts



Updates your profile script for all PowerShell hosts to import the posh-git

module whenever any PowerShell host starts.











RELATED LINKS