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
{ | |
"totalCount": 1, | |
"documentLinks": [ | |
"/resources/compute/2fc3b93fb41c4d2a9e90def3de9b7" | |
], | |
"documentCount": 1, | |
"queryTimeMicros": 1000, | |
"documentVersion": 0, | |
"documentUpdateTimeMicros": 0, | |
"documentExpirationTimeMicros": 0, |
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
{ | |
"documentLinks": [ | |
"/relocation/onboarding/resource/aff80590-b5c5-4c72-8dcd-34db8e789ea3" | |
], | |
"documents": { | |
"/relocation/onboarding/resource/aff80590-b5c5-4c72-8dcd-34db8e789ea3": { | |
"planLink": "/relocation/onboarding/plan/afa87b23bf71470f91d9eecd46358", | |
"resourceLink": "/resources/compute/805c89e91c824734b1d47fb9da8bb", | |
"deploymentLink": "/relocation/onboarding/deployment/7bbdae56d4e5477eb28c40803d1a3", | |
"resourceName": "TEST001", |
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
--- | |
- hosts: all | |
tasks: | |
- name: Copy a single file | |
win_copy: | |
src: "{{ playbook_dir }}/files/test-output.ps1" | |
dest: C:\Temp\test-output.ps1 | |
- name: Run a script |
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
#Requires -RunAsAdministrator | |
$ErrorActionPreference ='Stop' | |
# Get a service which doesn't exist | |
try { | |
Get-Service "This will fail" | |
} | |
catch { | |
Write-Error "Unable find service" -ErrorAction Continue |
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
--- | |
- hosts: all | |
tasks: | |
- name: Copy a single file | |
win_copy: | |
src: "{{ playbook_dir }}/files/Example-ErrorHandling.ps1" | |
dest: C:\Temp\Example-ErrorHandling.ps1 | |
- name: Run a script |
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
Set-Content -Path C:\Temp\test3.txt -Value "That's so wizard Ani" |
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: Copy a single file | |
win_copy: | |
src: "{{ playbook_dir }}/files/test.ps1" | |
dest: C:\Temp\test.ps1 | |
- name: Run a script | |
win_shell: C:\temp\test.ps1 |
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: Run multi-lined shell commands | |
win_shell: | | |
$text = Get-Content C:\Temp\test.txt | |
$text += ' General Kenobi....you are a bold one' | |
Set-Content -Path C:\Temp\test2.txt -Value $text |
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: Single line PowerShell | |
win_shell: Set-Content -Path C:\temp\test.txt -Value 'Hello there. ' |
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
--- | |
- hosts: all | |
tasks: | |
- name: Single line PowerShell | |
win_shell: Set-Content -Path C:\temp\test.txt -Value 'Hello there. ' | |
- name: Run multi-lined shell commands | |
win_shell: | | |
$text = Get-Content C:\Temp\test.txt |