Removes a path from the $Powdrgit.Path module variable.
Remove-PowdrgitPath [-Path] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
Removes a path from the $Powdrgit.Path module variable. When a path is removed, $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.
## Remove empty, whitespace, or null paths ##
PS C:\> $Powdrgit.Path = 'C:\Temp\a;C:\Temp\b;C:\Temp\c'
PS C:\> Remove-PowdrgitPath -Path $null
PS C:\> Remove-PowdrgitPath -Path ''
PS C:\> Remove-PowdrgitPath -Path ';'
PS C:\> $Powdrgit.Path
C:\Temp\a;C:\Temp\b;C:\Temp\c
# Empty paths are ignored.
## Remove valid paths ##
PS C:\> $Powdrgit.Path = 'C:\Temp\a;C:\Temp\b;C:\Temp\c'
PS C:\> Remove-PowdrgitPath -Path 'C:\Temp\b;C:\Temp\a'
PS C:\> $Powdrgit.Path
C:\Temp\c
PS C:\> Remove-PowdrgitPath -Path 'C:\Temp\c','C:\Temp\b'
PS C:\> $null -eq $Powdrgit.Path
True
# When all paths are removed from $Powdrgit.Path, it is set to $null.
## Pipe into Remove-PowdrgitPath ##
PS C:\> $Powdrgit.Path = 'C:\PowdrgitExamples\MyToolbox;C:\PowdrgitExamples\NotAGitRepo;C:\PowdrgitExamples\Project1'
PS C:\> Get-ChildItem -Path 'C:\PowdrgitExamples' -Directory | Remove-PowdrgitPath
PS C:\> $null -eq $Powdrgit.Path
True
# Get-ChildItem is used here by way of example. Repository paths can also be retrieved using Get-GitRepo or Test-PowdrgitPath.
The paths to be removed. Can be an array of strings, or a 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