Skip to content

Commit

Permalink
Add foghost name tab completion #8 - formatting fix and added some docs
Browse files Browse the repository at this point in the history
Gh actions releases #18 - more progress towards auto release
  • Loading branch information
darksidemilk committed Aug 22, 2024
1 parent 10dc8db commit 8824ede
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,32 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Call main workflow that calls all the distros
- name: Run the build test workflow
run: gh workflow run build-test.yml
env:
GH_TOKEN: ${{ github.token }}

confirm-build-test:
needs: run-build-test
runs-on: windows-latest
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- name: Wait a minute for the runs to start
- name: Wait for the runs to start
run: start-sleep 60

- name: Get run IDs
run: |
$runid=((& gh run list --workflow built-test.yml --json databaseId --limit 1) | convertfrom-json)[0].databaseId
$runid=((& gh run list --workflow build-test.yml --json databaseId --limit 1) | convertfrom-json).databaseId
echo "RUNID=$runid" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: confirm build didn't fail
run: |
$runstatus=""
while (($runstatus -ne "success") -AND ($run_status -ne "failure")) {
while (($runstatus -ne "success") -AND ($runstatus -ne "failure")) {
start-sleep 15
$runstatus=((& gh run view $env:RUN_ID --exit-status --json conclusion) | Convertfrom-json).conclusion
$runstatus=((& gh run view $env:RUNID --exit-status --json conclusion) | Convertfrom-json).conclusion
}
if ($runstatus -eq "failure") {
exit 1
Expand Down
27 changes: 13 additions & 14 deletions FogApi/Public/Get-FogHost.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Get-FogHost {
the uuid of the host
.PARAMETER hostName
the hostname of the host
the hostname of the host, if your FOG version is 1.6 or above you can use tab complete for hostnames
.PARAMETER macAddr
a mac address linked to the host
Expand All @@ -25,6 +25,7 @@ function Get-FogHost {
Get-FogHost -hostName MeowMachine
This would return the fog details of a host named MeowMachine in your fog instance
If using pwsh 7+ and your FOG service is 1.6 or above, you can tab complete to search for existing hosts by name
.EXAMPLE
Get-FogHost
Expand All @@ -48,21 +49,19 @@ function Get-FogHost {
[parameter(ParameterSetName='searchTerm')]
[string]$uuid,
[parameter(ParameterSetName='searchTerm')]
[ArgumentCompleter(
{
param($Command, $Parameter, $WordToComplete, $CommandAst, $FakeBoundParams)
if(test-fogverabove1dot6) {
$r = (Get-FogHosts).Name

if ($WordToComplete) {
$r.Where{ $_ -match "^$WordToComplete" }
}
else {
$r
}
[ArgumentCompleter({
param($Command, $Parameter, $WordToComplete, $CommandAst, $FakeBoundParams)
if(Test-FogVerAbove1dot6) {
$r = (Get-FogHosts).Name

if ($WordToComplete) {
$r.Where{ $_ -match "^$WordToComplete" }
}
else {
$r
}
}
)]
})]
[string]$hostName,
[parameter(ParameterSetName='searchTerm')]
[string]$macAddr,
Expand Down

0 comments on commit 8824ede

Please sign in to comment.