Update Connect-LMAccount.ps1 #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test Current Build on PowerShell Core | |
on: | |
push: | |
branches: | |
- '**' | |
paths-ignore: | |
- '**.md' | |
- '**.yml' | |
- '**.xml' | |
workflow_dispatch: | |
jobs: | |
test-build: | |
runs-on: ubuntu-latest | |
environment: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build and Test | |
env: | |
LM_ACCESS_ID: ${{ secrets.LM_ACCESS_ID }} | |
LM_ACCESS_KEY: ${{ secrets.LM_ACCESS_KEY }} | |
LM_PORTAL: ${{ secrets.LM_PORTAL }} | |
LM_BEARER_TOKEN: ${{ secrets.LM_BEARER_TOKEN }} | |
BUILD_VERSION: 9.9.9 | |
shell: pwsh | |
run: | | |
./Build.ps1 | |
$Data = @{ | |
AccessId="$env:LM_ACCESS_ID" | |
AccessKey="$env:LM_ACCESS_KEY" | |
AccountName="$env:LM_PORTAL" | |
BearerToken="$env:LM_BEARER_TOKEN" | |
Module="./Logic.Monitor.psd1" | |
PreferredCollectorId="8" | |
} | |
$Version = $PSVersionTable.PSVersion | |
Write-Host "Powershell version: $Version" | |
$Container = New-PesterContainer -Path ./Tests/ -Data $Data | |
$Result = Invoke-Pester -Container $Container -Output Detailed -PassThru | |
#Write OpsNote to test portal indicating test status | |
Connect-LMAccount -AccessId $env:LM_ACCESS_ID -AccessKey $env:LM_ACCESS_KEY -AccountName $env:LM_PORTAL -DisableConsoleLogging | |
$TimeNow = Get-Date -UFormat %m%d%Y-%H%M | |
$OpsNote = New-LMOpsNote -Note "Github test build submitted on $TimeNow - $($Result.Result)" -Tags @("GithubActions","TestPipeline-Core","PSVersion-$Version") | |