modery / PowerDocu

Generate technical documentation from your existing Power Automate Flows and Power Apps canvas apps
MIT License
440 stars 73 forks source link

Error running PowerDocu.exe through PowerShell #161

Open fabipfr opened 3 months ago

fabipfr commented 3 months ago

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 commented 3 months ago

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 commented 3 months ago

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 commented 2 weeks ago

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?