Piped directory creation to verbose instead of output

This commit is contained in:
Zachary Gorman 2025-05-06 12:11:50 -07:00
parent 97cd6b84fd
commit d5821e17a5
2 changed files with 3 additions and 3 deletions

View file

@ -77,7 +77,7 @@
Get-Item -Path "$Source\*" -Exclude ('Teams') | ForEach-Object { Get-Item -Path "$Source\*" -Exclude ('Teams') | ForEach-Object {
$tmpDst = Join-Path $Destination $_.Name $tmpDst = Join-Path $Destination $_.Name
if( -not ( Test-Path -Path $tmpDst -PathType Container ) ){ if( -not ( Test-Path -Path $tmpDst -PathType Container ) ){
New-Item "$tmpDst" -ItemType Container New-Item "$tmpDst" -ItemType Container | Write-Verbose
} }
Copy-Directory $_ $tmpDst -ProgressBarIndex 1 | Out-File $log -Append Copy-Directory $_ $tmpDst -ProgressBarIndex 1 | Out-File $log -Append
} }
@ -108,8 +108,8 @@ function Copy-Directory {
Get-ChildItem -Recurse $SourceDir | ForEach-Object { $TotalLength += $_.Length } Get-ChildItem -Recurse $SourceDir | ForEach-Object { $TotalLength += $_.Length }
$ProgressLength = 0 $ProgressLength = 0
Get-ChildItem $SourceDir | ForEach-Object { Get-ChildItem $SourceDir | ForEach-Object {
Write-Progress -Activity "Copying Directory" -Status "$SourceDir to $DestDir" -Id $ProgressBarIndex -PercentComplete $($ProgressLength*100/$TotalLength)
$item = $_ $item = $_
Write-Progress -Activity "Copying Directory $SourceDir to $DestDir" -Status "$item" -Id $ProgressBarIndex -PercentComplete $($ProgressLength*100/$TotalLength)
$DestDirPath = Join-Path $DestDir $item.Name $DestDirPath = Join-Path $DestDir $item.Name
switch -Regex ($item.Mode) { switch -Regex ($item.Mode) {
'd-----' { 'd-----' {

View file

@ -1,7 +1,7 @@
Patch Patch
-Update Custom SHSApps have more robust detection -Update Custom SHSApps have more robust detection
-Fix SCCM queries return mac address correctly -Fix SCCM queries return mac address correctly
-Update UserProfileBackup has progress bars! -Add UserProfileBackup has progress bars!
-Update UserProfileBackup doesn't copy Sticky Notes anymore -Update UserProfileBackup doesn't copy Sticky Notes anymore
-Update UserProfileBackup reports fewer non-critical errors -Update UserProfileBackup reports fewer non-critical errors