You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+47-1Lines changed: 47 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Login to Azure before running Azure PowerShell scripts using [Azure Login](https
13
13
14
14
Once login is done, Azure PowerShell action will use the same session to run the script.
15
15
16
-
#### Sample workflow to run inlinescript using Azure PowerShell
16
+
#### Sample workflow to run inlinescript
17
17
```yaml
18
18
on: [push]
19
19
@@ -50,6 +50,52 @@ Additionally the action supports two optional parameters
50
50
- `errorActionPreference` : select a suitable value for the variable for executing the script. Allowed values are `stop`, `continue`, `silentlyContinue`. Default is `Stop`.
51
51
- `failOnStandardError` : By default this is marked as `false`. But if this is marked as `true`, the action will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream.
52
52
53
+
#### Sample workflow to run a script file in your repository
54
+
```yaml
55
+
# File: ./scripts/run_azps_cmdlets.ps1
56
+
on: [push]
57
+
58
+
name: AzurePowerShellSampleWithFile
59
+
60
+
jobs:
61
+
62
+
build:
63
+
runs-on: ubuntu-latest
64
+
steps:
65
+
66
+
- name: Check Out
67
+
uses: actions/checkout@v3
68
+
69
+
- name: Login Azure
70
+
uses: azure/login@v1
71
+
with:
72
+
creds: ${{secrets.AZURE_CREDENTIALS}}
73
+
enable-AzPSSession: true
74
+
75
+
- name: Run Azure PowerShell Script File
76
+
uses: azure/powershell@v1
77
+
with:
78
+
inlineScript: ./scripts/run_azps_cmdlets.ps1
79
+
azPSVersion: "latest"
80
+
```
81
+
You have to check out the repository before running the script file.
82
+
You can also run the script file with parameters. For example:
0 commit comments