Replies: 1 comment
-
Not helping, I know, but I have the exact same issue... I'm on Powershell 7.4.1 running PnP.Powershell 2.3.0 on a Windows 11 machine. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Notice
Many bugs reported are actually related to the PnP Framework which is used behind the scenes. Consider carefully where to report an issue:
Are you using
Invoke-PnPSiteTemplate
orGet-PnPSiteTemplate
?No
Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue?
Yes
Reporting an Issue or Missing Feature
When running
Get-PnPFile -URL {urlHere} -Path {LocalPathHere} -FileName {FileNameHere} -Connection {StoredConnectionVariableHere} -AsFile -Force
from a WPF runspace the command hangs, however if the same runspace launches another runspace and runs the same command from that runspace it works fine.If I run the command using debug or pressing F8 and stepping through the code line by line, it works perfectly fine.
Expected behavior
I expect the file located at the URL in the URL param to be downloaded to the local path specified in the Path param and named the name as specified in the FileName param.
Actual behavior
When stepping through the script using F8 and passing the required params to the Get-PnPFile cmdlet, the file is downloaded from the sharepoint list and placed in the path and called what is in the FileName param, properly.
When running the script which launches the WPF application, when I activate the code block that performs the Get-PnPFile action, the code simply hangs eternally. There is no output, and no timeout, or error.
If I start another runspace and run the same command from that runspace the file is downloaded from the sharepoint list and placed in the path and called what is in the FileName param, properly.
Steps to reproduce behaviour
You need to create a basic WPF application with a XAML UI.
Add a button to the xaml and a Click event to the button that calls a function that downloads a file from a sharepoint list.
We are downloading image files from our sharepoint list to a local folder, even the root of D drive with full permissions is ok.
When the button is clicked, it should attempt to download the file from sharepoint to the local path.
To fix the issue, create a new runspace and run the same command from the runspace and it should work.
I will try and get you a working file soon if I can.
What is the version of the Cmdlet module you are running?
It doesn't work on 1.12.0 through to the latest version
Which operating system/environment are you running PnP PowerShell on?
Windows
Beta Was this translation helpful? Give feedback.
All reactions