standardise the powershell FileUtils (#34969)

This commit is contained in:
Jordan Borean 2018-01-17 14:16:34 +10:00 committed by GitHub
commit 6f9f337a67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 86 additions and 73 deletions

View file

@ -119,7 +119,7 @@ if ($path -eq $null -and $port -eq $null -and $state -eq "drained") {
$complete = $false
while (((Get-Date) - $start_time).TotalSeconds -lt $timeout) {
$attempts += 1
if (Test-FilePath -path $path) {
if (Test-AnsiblePath -Path $path) {
if ($search_regex -eq $null) {
$complete = $true
break
@ -150,7 +150,7 @@ if ($path -eq $null -and $port -eq $null -and $state -eq "drained") {
$complete = $false
while (((Get-Date) - $start_time).TotalSeconds -lt $timeout) {
$attempts += 1
if (Test-FilePath -path $path) {
if (Test-AnsiblePath -Path $path) {
if ($search_regex -ne $null) {
$file_contents = Get-Content -Path $path -Raw
if ($file_contents -notmatch $search_regex) {