From e50ada51920a97144dcce6453ce1cfa8c402d975 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 29 Dec 2022 16:44:54 +0100 Subject: [PATCH] Change file write order --- files/ConfigureRemotingForAnsible.ps1 | 2 +- files/upgrade_to_ps3.ps1 | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/files/ConfigureRemotingForAnsible.ps1 b/files/ConfigureRemotingForAnsible.ps1 index 125ce47..af52dd2 100644 --- a/files/ConfigureRemotingForAnsible.ps1 +++ b/files/ConfigureRemotingForAnsible.ps1 @@ -435,6 +435,6 @@ Else { [System.IO.Directory]::CreateDirectory('.ansible\status') attrib +h .ansible -Add-Content -Path .ansible/status/ConfigureRemotingForAnsible.txt -Value "PS Remoting has been successfully configured for Ansible. See https://backwesen.de/voc/win_ansible_role_winrm.git" +Add-Content -Path .ansible\status\ConfigureRemotingForAnsible.txt -Value "PS Remoting has been successfully configured for Ansible. See https://backwesen.de/voc/win_ansible_role_winrm.git" Write-VerboseLog "PS Remoting has been successfully configured for Ansible." diff --git a/files/upgrade_to_ps3.ps1 b/files/upgrade_to_ps3.ps1 index 397b41d..566a3e2 100644 --- a/files/upgrade_to_ps3.ps1 +++ b/files/upgrade_to_ps3.ps1 @@ -17,6 +17,10 @@ # 6.2 is 2012 # 6.3 is 2012 R2 +[System.IO.Directory]::CreateDirectory('.ansible\status') +attrib +h .ansible +Add-Content -Path .ansible\status\upgrade_to_ps3.txt -Value "PS2 upgrades to PS3. See https://backwesen.de/voc/win_ansible_role_winrm.git" + if ($PSVersionTable.psversion.Major -ge 3) { Write-Output "Powershell 3 Installed already; You don't need this" @@ -82,8 +86,3 @@ $FileName = $DownLoadUrl.Split('/')[-1] download-file $downloadurl "$powershellpath\$filename" Start-Process -FilePath "$powershellpath\$filename" -ArgumentList /quiet - -[System.IO.Directory]::CreateDirectory('.ansible\status') -attrib +h .ansible -Add-Content -Path .ansible/status/upgrade_to_ps3.txt -Value "PS2 upgrades to PS3. See https://backwesen.de/voc/win_ansible_role_winrm.git" -