forked from jdhitsolutions/PSReleaseTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPSReleaseTools.psm1
More file actions
31 lines (27 loc) · 1.07 KB
/
Copy pathPSReleaseTools.psm1
File metadata and controls
31 lines (27 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#load functions
Get-ChildItem -Path $PSScriptRoot\functions\*.ps1 |
ForEach-Object {
. $_.fullname
}
#configure TLS settings for GitHub
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
#cache issue labels
$global:PSIssueLabel = Get-PSIssueLabel
#define an autocompleter for Get-PSIssue
Register-ArgumentCompleter -CommandName Get-PSIssue -ParameterName Label -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
Try {
Get-Variable PSIssuleLabel -Scope global -ErrorAction stop
}
Catch {
$global:PSIssueLabel = Get-PSIssueLabel
}
#PowerShell code to populate $wordtoComplete
($global:psissuelabel).where( { $_.name -like "*$wordToComplete*" }) | ForEach-Object {
# completion text,listitem text,result type,Tooltip
if (-not $_.description) {
$_.description = "no description"
}
[System.Management.Automation.CompletionResult]::new($_.name, $_.name, 'ParameterValue', $_.description)
}
}