diff --git a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Backup.psm1 b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Backup.psm1 index aad9eb4838b..6b5be0fa634 100644 --- a/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Backup.psm1 +++ b/lib/ansible/module_utils/powershell/Ansible.ModuleUtils.Backup.psm1 @@ -19,15 +19,15 @@ Function Backup-File { $backup_path = $null if (Test-Path -LiteralPath $path -PathType Leaf) { - $dirname = Split-Path -Parent $path -Resolve + $dirname = Split-Path -Parent $path -Resolve - # set variables for templating purposes - $basename = Split-Path -Path $path -Leaf -Resolve - $stripname = Split-Path -Path $path -LeafBase -Resolve - $extension = Split-Path -Path $path -Extension -Resolve - $timestamp = [DateTime]::Now.ToString("yyyyMMdd-HHmmss") + # set variables for templating purposes + $basename = Split-Path -Path $path -Leaf -Resolve + $stripname = Split-Path -Path $path -LeafBase -Resolve + $extension = Split-Path -Path $path -Extension -Resolve + $timestamp = [DateTime]::Now.ToString("yyyyMMdd-HHmmss") - # TODO: make childpath configurable via template stirng from config + # TODO: make childpath configurable via template stirng from config $backup_path = Join-Path -Path $dirname -ChildPath "$basename.$pid.$timestamp.bak" Try { Copy-Item -LiteralPath $path -Destination $backup_path