Get-ChildItem "$Folder" *.xlsx -Recurse | ?{-not ($_.PSIsContainer -or (Test-Path "I:\TEMP_Dir_SSN\$_"))} | copy-Item -Destination "I:TEMP_Dir_SSN" | out-null
Get-ChildItem "$Folder" *.xlsx -Recurse | %{
$test = Resolve-Path $_.FullName
$holdArray += $test.path
}
$holdArray | out-file "I:\TEMP_Dir_SSN\fullPath.txt" -append
The output:
I:\1992.xlsxI:\projects\confluence\projects\documents\XXXX_ComplianceRegulations.xlsxI:\projects\confluence\projects\documents\XXXX_vendorCloudStandardsPoliciesRegs.xlsx
I want it:
I:\1992.xlsx
I:\projects\confluence\projects\documents\XXXX_ComplianceRegulations.xlsx
I:\projects\confluence\projects\documents\XXXX_vendorCloudStandardsPoliciesRegs.xlsx
I'm not sure what is going wrong here. It should be adding it to the next line down, not appending it to the end of the string.