AzPSVarReuse #14
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: AzPSVarReuse | |
on: [workflow_dispatch] | |
jobs: | |
Resources: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/login@v2 | |
with: | |
creds: ${{secrets.AZURE_CREDENTIALS}} | |
enable-AzPSSession: true | |
- name: Run Azure PowerShell Script File | |
uses: azure/powershell@v2 | |
with: | |
inlineScript: ./GHActionTest/FuncVar.ps1 | |
azPSVersion: 'latest' | |
- name: Use RG Name | |
run: | | |
$env:RG_NAME | ConvertFrom-Json | |
shell: pwsh | |
# (Get-Content $env:RG_NAME) | ConvertFrom-Json #Doesn't work | |
# (Get-Content env:RG_NAME) | ConvertFrom-Json #works | |
# ((GC env:RG_NAME) | ConvertFrom-Json).ResourceGroupName | |
# $rgName = "${{ env.RG_NAME }}" #Works for string, not for PSObjects | |
# Write-Host "Using Resource Group Name: $rgName" | |
#Get-ChildItem env:|? Name -like 'GITHUB_*' |