Make sure your working directory exists

was just using Export-PWDocuments and no matter what I tried it wouldn't export files, it would create the folder tree, report that it found matches then just exit. no error.  Finally I opened PW Explorer, logged in the datasource and let it create the working directory.  Export immediately started working.

So if you're having weird issues you might try making sure the working directory exists for the account you're logging in with.

Kevin

P.S. A warning message on login when it doesn't exist would be nice.

Parents
  • Using New-PWLogin would resolve the issue as it tests for the working directory and creates it if needed.

    Or, you could add something like the following to your script to verify and create the working directory if needed.

    $WorkDir = Get-PWUserSetting -UserID ([pwwrapper]::aaApi_GetCurrentUserId()) -SettingName WorkingDirectory_WhenUsingProjectWiseExplorer -Verbose

    if(Test-Path -Path $($WorkDir).UserSettingValue) {
        "Workdir exists."
    } else {
        "Workdir does not exist. Create."
        New-Item -Path $($WorkDir).UserSettingValue -ItemType directory
    }

Reply
  • Using New-PWLogin would resolve the issue as it tests for the working directory and creates it if needed.

    Or, you could add something like the following to your script to verify and create the working directory if needed.

    $WorkDir = Get-PWUserSetting -UserID ([pwwrapper]::aaApi_GetCurrentUserId()) -SettingName WorkingDirectory_WhenUsingProjectWiseExplorer -Verbose

    if(Test-Path -Path $($WorkDir).UserSettingValue) {
        "Workdir exists."
    } else {
        "Workdir does not exist. Create."
        New-Item -Path $($WorkDir).UserSettingValue -ItemType directory
    }

Children
No Data