Adds a path to the $Powdrgit.Path module variable.
Add-PowdrgitPath [-Path] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Adds a path to the $Powdrgit.Path module variable. When a path is added, $Powdrgit.Path is (re)written as a unique sorted list of paths. If there are no paths in $Powdrgit.Path, it is set to $null.
## Add empty, whitespace, or null path to $Powdrgit.Path ##
PS C:\> $Powdrgit.Path = $null
PS C:\> Add-PowdrgitPath -Path $null
PS C:\> Add-PowdrgitPath -Path ''
PS C:\> Add-PowdrgitPath -Path ';'
PS C:\> $null -eq $Powdrgit.Path
True
# Empty paths are ignored.
## Add valid paths to $Powdrgit.Path ##
PS C:\> $Powdrgit.Path = $null
PS C:\> Add-PowdrgitPath -Path 'C:\Temp\b;C:\Temp\a'
PS C:\> Add-PowdrgitPath -Path 'C:\Temp\c','C:\Temp\b'
PS C:\> $Powdrgit.Path
C:\Temp\a;C:\Temp\b;C:\Temp\c
# Paths are always de-duplicated and ordered.
## Pipe values into Add-PowdrgitPath ##
PS C:\> $Powdrgit.Path = $null
PS C:\> Get-ChildItem -Path 'C:\PowdrgitExamples' -Directory | Add-PowdrgitPath
PS C:\> $Powdrgit.Path
C:\PowdrgitExamples\MyToolbox;C:\PowdrgitExamples\NotAGitRepo;C:\PowdrgitExamples\Project1
# Paths can be piped in.
# Get-ChildItem is used here by way of example. The preferred way to add repository paths is with Find-GitRepo, e.g.:
# Find-GitRepo -Path 'C:\PowdrgitExamples' -AppendPowdrgitPath
The paths to be added. Can be an array of strings, with each string containing a semicolon-separated list of paths. Empty, whitespace, or null paths are ignored.
Type: String[]
Parameter Sets: (All)
Aliases: FullName
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: FalsePrompts you for confirmation before running the cmdlet.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseShows what would happen if the cmdlet runs. The cmdlet is not run.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
[System.String[]]
Accepts string objects via the Path parameter.
[System.Void]
The function does not return anything.
Author : nmbell