Skip to content

Commit

Permalink
Update Test1.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelhor authored Jul 26, 2024
1 parent 4712b8c commit f13e565
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/Test1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ jobs:
shell: pwsh
run: Write-Host $PSVersionTable.PSVersion

- name: Setup PowerShell module cache
id: cacher
uses: actions/cache@v3
with:
path: "~/.local/share/powershell/Modules"
key: ${{ runner.os }}-MicrosoftGraphBeta

- name: Install required PowerShell modules
if: steps.cacher.outputs.cache-hit != 'true'
shell: pwsh
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Microsoft.Graph.Beta -ErrorAction Stop
# Coonect
- name: Connect, run the script and disconnect
shell: pwsh
Expand All @@ -37,9 +51,6 @@ jobs:
AppSec: ${{ secrets.AppSec }}
WebAppId: ${{ vars.WebAppId }}
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module Microsoft.Graph -Scope CurrentUser
Write-Host "Connect to Microsoft Entra ID with app ID and app secret"
$SecuredPassword = ConvertTo-SecureString -String "$env:AppSec" -AsPlainText -Force
$ClientSecretCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "$env:AppId", $SecuredPassword
Expand Down

0 comments on commit f13e565

Please sign in to comment.