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

MacOSX compatibility? #6

Closed
evandrix opened this issue Feb 12, 2020 · 2 comments
Closed

MacOSX compatibility? #6

evandrix opened this issue Feb 12, 2020 · 2 comments

Comments

@evandrix
Copy link

on PowerShell 6.2.3 on macOS Catalina 10.15.3

PS /Users/user> Show-Ast
Add-Type : Cannot find path '/Users/user/Downloads/System.Windows.Forms.dll' because it does not exist.
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:24 char:9
+         Add-Type -Assembly System.Windows.Forms
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (/Users/user/Downloa\u2026m.Windows.Forms.dll:String) [Add-Type], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.AddTypeCommand

New-Object : Exception calling ".ctor" with "2" argument(s): "The type initializer for 'Gdip' threw an exception."
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:26 char:17
+         $font = New-Object System.Drawing.Font ("Consolas", 12.0)
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
+ FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

Unable to find type [Windows.Forms.TreeView].
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:151 char:22
+         $treeView = [Windows.Forms.TreeView]@{
+                      ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Windows.Forms.TreeView:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound

You cannot call a method on a null-valued expression.
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:158 char:9
+         $treeView.Add_AfterSelect( { OnAfterSelect @args } )
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

The property 'Nodes' cannot be found on this object. Verify that the property exists.
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:183 char:9
+         AddChildNode $InputObject $treeView.Nodes
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

Unable to find type [Windows.Forms.DataGridView].
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:186 char:22
+         $dataView = [Windows.Forms.DataGridView]@{
+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Windows.Forms.DataGridView:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound

The property 'Columns' cannot be found on this object. Verify that the property exists.
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:202 char:9
+         $dataView.Columns.AddRange(
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], PropertyNotFoundException
+ FullyQualifiedErrorId : PropertyNotFoundStrict

Unable to find type [System.Windows.Forms.TextBox].
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:221 char:24
+         $scriptView = [System.Windows.Forms.TextBox]@{
+                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (System.Windows.Forms.TextBox:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound

You cannot call a method on a null-valued expression.
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:234 char:9
+         $scriptView.Add_TextChanged({ $script:BufferIsDirty = $true } ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

You cannot call a method on a null-valued expression.
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:235 char:9
+         $scriptView.Add_KeyUp({ OnTextBoxKeyUp @args })
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull

The variable '$form' cannot be retrieved because it has not been set.
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:251 char:13
+             $form.Dispose()
+             ~~~~~
+ CategoryInfo          : InvalidOperation: (form:String) [], RuntimeException
+ FullyQualifiedErrorId : VariableIsUndefined

Unable to find type [Windows.Forms.Form].
At /Users/user/.local/share/powershell/Modules/ShowPSAst/1.0/ShowPSAst.psm1:242 char:22
+             $form = [Windows.Forms.Form]@{
+                      ~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : InvalidOperation: (Windows.Forms.Form:TypeName) [], RuntimeException
+ FullyQualifiedErrorId : TypeNotFound
@mklement0
Copy link
Contributor

The current implementation is WinForms-based and therefore by definition Windows-only.
I've created #10 to suggest noting that fact prominently in the read-me.

Making the module cross-platform, such as via Terminal.Gui, would be great, but amounts to a nontrivial effort.

A cross-platform version of Show-Ast would make for a great addition to the already Terminal.Gui-based Microsoft.PowerShell.ConsoleGuiTools tools (which currently provide Out-GridConsoleView and Show-ObjectTree), so I've created a feature request there:

@lzybkr
Copy link
Owner

lzybkr commented May 7, 2024

I have no plans to add OSX support. I would support a fork of the project that wants to go in that direction though.

@lzybkr lzybkr closed this as completed May 7, 2024
@lzybkr lzybkr closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
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