Using Get-PWDocumentsBySearchWithReturnColumns, returning document properites

All,

So trying out both search CMDLETS

Option A) Get-PWDocumentsBySearchWithReturnColumns

Option B) Get-PWDocumentsBySearch

I want the return search to populate the FileUpdateDate AND FileUpdater, i can only get this if i use Option B with the -Slow switch,HOWEVER i need to have a date Range with is available in Option A

I tried the -Slow switch in Option A, but it isnt valid, is there a "best of both worlds"

TIA

Stephen

Parents
  • Hey Stephen,

    You could try something like the following. Create a saved search using the dates. Get the documents and then remove the saved search.

    $WorkArea = Show-PWFolderBrowserDialog
    $SavedSearchName = 'psTempSearch'
    $DateAfter = '1/1/2020'
    $DateBefore = '10/2/2020'
    
    $Splat_SavedSearch = @{
        OwnerProject = $WorkArea 
        SearchName = $SavedSearchName
        SearchFolder = $WorkArea.FullPath
        SearchSubFolders = $true
        OriginalsOnly = $true
        UpdatedAfter = $DateAfter
        UpdatedBefore = $DateBefore
        ReplaceExisting = $true
    }
    Add-PWSavedSearch @Splat_SavedSearch -Verbose
    
    Get-PWDocumentsBySearch -SearchName "$($WorkArea.FullPath)\$SavedSearchName"
    
    Remove-PWSavedSearch -InputFolder $WorkArea -SearchName $SavedSearchName

Reply
  • Hey Stephen,

    You could try something like the following. Create a saved search using the dates. Get the documents and then remove the saved search.

    $WorkArea = Show-PWFolderBrowserDialog
    $SavedSearchName = 'psTempSearch'
    $DateAfter = '1/1/2020'
    $DateBefore = '10/2/2020'
    
    $Splat_SavedSearch = @{
        OwnerProject = $WorkArea 
        SearchName = $SavedSearchName
        SearchFolder = $WorkArea.FullPath
        SearchSubFolders = $true
        OriginalsOnly = $true
        UpdatedAfter = $DateAfter
        UpdatedBefore = $DateBefore
        ReplaceExisting = $true
    }
    Add-PWSavedSearch @Splat_SavedSearch -Verbose
    
    Get-PWDocumentsBySearch -SearchName "$($WorkArea.FullPath)\$SavedSearchName"
    
    Remove-PWSavedSearch -InputFolder $WorkArea -SearchName $SavedSearchName

Children