Page 1 of 1

Show-Command does not work in Sapien Powershell Studio 2021

Posted: Mon Oct 18, 2021 10:03 am
by israelrr89
Event:
$buttonSearch_Click={
#SearchGrid
Show-Command get-acl
}

error:--------------------------------------------

>> Running (test.psf) Script...
>> Platform: V5 64Bit (STA) (Forced)
ERROR: Show-Command : Object reference not set to an instance of an object.
test.psf (269, 2): ERROR: At Line: 269 char: 2
ERROR: + Show-Command get-acl
ERROR: + ~~~~~~~~~~~~~~~~~~~~
ERROR: + CategoryInfo : InvalidOperation: (get-acl:String) [Show-Command], NullReferenceException
ERROR: + FullyQualifiedErrorId : CannotProcessRecordForOneCommand,Microsoft.PowerShell.Commands.ShowCommandCommand
ERROR:

Re: Show-Command does not work in Sapien Powershell Studio 2021

Posted: Mon Oct 18, 2021 10:15 am
by brittneyr
[Topic moved by moderator to PowerShell Studio forum]

Re: Show-Command does not work in Sapien Powershell Studio 2021

Posted: Mon Oct 18, 2021 10:15 am
by brittneyr
We are looking into this and will get back to you soon.

Re: Show-Command does not work in Sapien Powershell Studio 2021

Posted: Tue Oct 19, 2021 1:31 pm
by Alexander Riedel
The Show-Command is a learning tool cmdlet specifically designed for typing in a console. It was not designed for use in a GUI environment.
Since GUI processes normally do not have a console, this is not compatible.

Re: Show-Command does not work in Sapien Powershell Studio 2021

Posted: Wed Oct 20, 2021 5:52 am
by israelrr89
I noticed that Sapien Engines are not compatible, but this command is a Windows PowerShell cmdlet. Can you find a solution? I created an executable using the Script Engine/Windows Powershell/Microsoft Windows Powershell(Command line), but it will not work with any of the Sapien Script Engines. Can you make an Engine compatible with this? The problem with the Windows Engine is that it will open a command line in the background, and it will create a file with all the scripts.

Re: Show-Command does not work in Sapien Powershell Studio 2021

Posted: Wed Oct 20, 2021 8:59 am
by Alexander Riedel
You want a Microsoft cmdlet designed to require a console to work without having a console. You see how that does not go together?
Why don't we take a step back and you elaborate as to what you try to accomplish?