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

Error running PowerDocu.exe through PowerShell #161

Open
fabipfr opened this issue Aug 14, 2024 · 4 comments
Open

Error running PowerDocu.exe through PowerShell #161

fabipfr opened this issue Aug 14, 2024 · 4 comments

Comments

@fabipfr
Copy link

fabipfr commented Aug 14, 2024

I'm trying to run PowerDocu.exe with PowerShells "Start-Process" cmdlet. Currently I'm getting this error output:

[...]
FlowDocumenter: Created documentation for renamed_solution.zip. A total of 43 files were processed in 28,0676974 seconds.
 - Processing renamed_solution.zip
AppDocumenter: Created Word documentation for renamed_solution.zip. A total of 0 files were processed in 0,0139564 seconds.
 - Processing renamed_solution.zip
System.UnauthorizedAccessException: Access to the path 'C:\solution.xml' is denied.
   at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
   at System.IO.FileStream..ctor(String path, FileStreamOptions options)
   at System.IO.Compression.ZipFileExtensions.ExtractToFile(ZipArchiveEntry source, String destinationFileName, Boolean overwrite)
   at PowerDocu.Common.SolutionParser..ctor(String filename) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\modules\PowerDocu.Common\PowerDocu.Common\SolutionParser.cs:line 22
   at PowerDocu.SolutionDocumenter.SolutionDocumentationGenerator.GenerateDocumentation(String filePath, String fileFormat, Boolean documentDefaultChangesOnly, Boolean documentDefaults, String flowActionSortOrder, String wordTemplate, String outputPath) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\PowerDocu.SolutionDocumenter\SolutionDocumentationGenerator.cs:line 32
   at PowerDocu.GUI.PowerDocuCLI.GenerateDocumentation(CommandLineOptions options) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\PowerDocu.GUI\PowerDocuCLI.cs:line 80
   at PowerDocu.GUI.PowerDocuCLI.Run(String[] args) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\PowerDocu.GUI\PowerDocuCLI.cs:line 58

Before [...] the output suggests that everything works fine and the documentation finished successfully

To Reproduce
Steps to reproduce the behavior:

  1. downloaded the PowerDocu-v.2.0.1.zip
  2. Opened PowerShell terminal inside the folder.
  3. Ran this command Start-Process -p "solution.zip" -o "outputPath" -m

I'm really looking forward for full CLI support! <3

@modery
Copy link
Owner

modery commented Aug 24, 2024

Hi @fabipfr , you mention Start-Process -p "solution.zip" -o "outputPath" -m which I'm struggling a bit with, can't replicate it with these parameters (PowerShell complains that -p and -o are ambigous, for example). Can you share more details how you're executing PowerDocu?

@fabipfr
Copy link
Author

fabipfr commented Aug 27, 2024

Sorry, the Start-Process Syntax was wrong, it should be like this:

Start-Process -NoNewWindow -FilePath "PowerDocu.exe" -ArgumentList "-p solution.zip", "-m", "-o outputPath"

I also ran the cmdlet with the new PowerDocu-v.2.1.0, but got the same output 🥲

@fabipfr
Copy link
Author

fabipfr commented Nov 5, 2024

I tried again as described with v2.1.0. I was able to Export Flows but not the Solution itself or a PowerApp. Got the same error as above, but this time with
System.UnauthorizedAccessException: Access to the path 'C:\powerapp.msal' is denied.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode) at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable1 unixCreateMode)
at System.IO.Strategies.FileStreamHelpers.ChooseStrategyCore(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
at System.IO.FileStream..ctor(String path, FileStreamOptions options)
at System.IO.Compression.ZipFileExtensions.ExtractToFile(ZipArchiveEntry source, String destinationFileName, Boolean overwrite)
at PowerDocu.Common.AppParser..ctor(String filename) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\modules\PowerDocu.Common\PowerDocu.Common\AppParser.cs:line 34
at PowerDocu.AppDocumenter.AppDocumentationGenerator.GenerateDocumentation(String filePath, String fileFormat, Boolean documentDefaultChangesOnly, Boolean documentDefaults, Boolean documentSampleData, String wordTemplate, String outputPath) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\PowerDocu.AppDocumenter\AppDocumentationGenerator.cs:line 18
at PowerDocu.SolutionDocumenter.SolutionDocumentationGenerator.GenerateDocumentation(String filePath, String fileFormat, Boolean documentDefaultChangesOnly, Boolean documentDefaults, Boolean documentSampleData, String flowActionSortOrder, String wordTemplate, String outputPath) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\PowerDocu.SolutionDocumenter\SolutionDocumentationGenerator.cs:line 24
at PowerDocu.GUI.PowerDocuCLI.GenerateDocumentation(CommandLineOptions options) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\PowerDocu.GUI\PowerDocuCLI.cs:line 80
at PowerDocu.GUI.PowerDocuCLI.Run(String[] args) in C:\Users\rene\GitHub\PowerDocu-Release\PowerDocu\PowerDocu.GUI\PowerDocuCLI.cs:line 58

Are there any updates or plans on CLI Support?

@fabipfr
Copy link
Author

fabipfr commented Dec 20, 2024

I just resolved this.
in the ArgumentsList the -p Parameter needs a Full Path (C:\Users...\solution.zip). If you reference a solution in the working directory (solution.zip) and not with the full path it leads to faulty paths like C:\solution.xml or C:\powerapp.msal. These files are supposed to be inside the solution.zip and not at C:.
So to get it working with PowerShell Start-Process Full Paths are required, referencing files directly from the working directory is buggy.

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

2 participants