Skip to content

AzPSVarReuse

AzPSVarReuse #14

Workflow file for this run

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_*'