Skip to content

Commit c08cf88

Browse files
authored
Merge pull request #3 from Tools4ever-NIM/msheldont4e-patch-1
Update File System.ps1
2 parents fabaa3a + a3c1f2f commit c08cf88

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

File System.ps1

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@ function Idm-SystemInfo {
4343
name = 'recursive'
4444
type = 'checkbox'
4545
label = 'Recursive'
46-
value = 'true'
46+
value = $true
4747
}
4848
@{
4949
name = 'ignoreACEPermissionErrors'
5050
type = 'checkbox'
5151
label = 'Ignore ACE Permission Errors'
52-
value = 'false'
52+
value = $false
5353
}
5454
@{
5555
name = 'skipFolderACL'
5656
type = 'checkbox'
5757
label = 'Skip Folder ACL''s'
58-
value = 'false'
58+
value = $false
5959
}
6060
)
6161
}
@@ -613,16 +613,9 @@ function Idm-FolderUpdate {
613613
$full_name = $function_params.FullName
614614

615615
if ($function_params.ContainsKey('Path')) {
616-
$p_last_backslash = $function_params.Path.LastIndexOf('\')
617-
618-
if ($p_last_backslash -gt 2) {
619-
# Create intermediate directories
620-
New-Item -ItemType Directory -Path ($function_params.Path.Substring(0, $p_last_backslash)) -ErrorAction SilentlyContinue
621-
}
622-
623-
LogIO info "Move-Item" -In -LiteralPath $full_name -Destination $function_params.Path
624-
$rv = Move-Item -PassThru -LiteralPath $full_name -Destination $function_params.Path | Select-Object -Property @{ Name = 'FullName'; Expression = {$_.FullName.TrimEnd('\')} }
625-
LogIO info "Move-Item" -Out $rv
616+
LogIO info "Rename-Item" -In -LiteralPath $function_params.FullName -Destination $function_params.Path
617+
$rv = Rename-Item -PassThru -LiteralPath $function_params.FullName -NewName $function_params.Path | Select-Object -Property @{ Name = 'FullName'; Expression = {$_.FullName.TrimEnd('\')} }
618+
LogIO info "Rename-Item" -Out $rv
626619

627620
$full_name = $rv.FullName
628621
}

0 commit comments

Comments
 (0)