Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write-RsCatalogItem Cannot use UNC Paths #33

Closed
JimmyParker opened this issue Mar 30, 2017 · 3 comments
Closed

Write-RsCatalogItem Cannot use UNC Paths #33

JimmyParker opened this issue Mar 30, 2017 · 3 comments

Comments

@JimmyParker
Copy link

JimmyParker commented Mar 30, 2017

Do you want to request a feature or report a bug?
bug
What is the current behavior?
Specifying a UNC path "\\server\share\myreport.rdl" for the -Path parameter results in error. I think this is due to the "Resolve-Path $item" in the code pre-pending "Microsoft.PowerShell.Core\FileSystem::" to the value. See verbose output below. Could wrapping the call with "Convert-Path (Resolve-Path $item)" fix the issue?

PS C:\Temp> Write-RsCatalogItem -ReportServerUri "http://someserver/ReportServer" `
    -Path "\\server\share\MyReport.rdl" `
    -Destination "/MyFolder"  -Override  -Verbose
VERBOSE: Uploading Microsoft.PowerShell.Core\FileSystem::\\server\share\MyReport.rdl to /MyFolder/MyReport
Exception calling "ReadAllBytes" with "1" argument(s): "The given path's format is not supported."
At C:\Program Files\WindowsPowerShell\Modules\ReportingServicesTools\0.0.0.15\Functions\CatalogItems\Write-RsCatalogItem.ps1:159 char:17
+                 $bytes = [System.IO.File]::ReadAllBytes($EntirePath)
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : NotSupportedException
 
Exception calling "CreateCatalogItem" with "7" argument(s): "The value for parameter 'Definition' is not specified. It is either missing from the function call, or it is set to null. ---> 
Microsoft.ReportingServices.Diagnostics.Utilities.MissingParameterException: The value for parameter 'Definition' is not specified. It is either missing from the function call, or it is set to null."
At C:\Program Files\WindowsPowerShell\Modules\ReportingServicesTools\0.0.0.15\Functions\CatalogItems\Write-RsCatalogItem.ps1:161 char:17
+ ...             $Proxy.CreateCatalogItem($itemType, $itemName, $RsFolder, ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : SoapException

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
Write-RsCatalogItem -ReportServerUri "http://someserver/ReportServer" -Path "\\server\share\myreport.rdl" -Destination "/Folder" -Override
What is the expected behavior?
Read file from UNC share.
Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?
I'm using 5 on Windows 10. Don't know if it worked in previous versions.

Thank You!

@JimmyParker
Copy link
Author

Out-RsCatalogItem and Out-RsFolderContent have the same issue with UNC paths and Resolve-Path.

@ClaudioESSilva
Copy link
Contributor

Hi @JimmyParker I have submitted a PR #67 that handles this.

image

@parthsha
Copy link
Contributor

Thanks @ClaudioESSilva for fixing this issue. I am going to go ahead and close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants