Jump to content

Powershell command script block output


Go to solution Solved by Danyfirex,

Recommended Posts

  • Solution
Posted (edited)

Hello.

Add  & to 

 /c powershell -Command "' & ' & {Get-NetAdapter | Where-Object InterfaceType -eq 71}'

or

Remove { and }

 

Saludos

Edited by Danyfirex
Posted

are you sure? 

 

this works for me:

Local $iPID = Run(@ComSpec & ' /c powershell -Command "' & '& {Write-Host "Danyfirex"}' & '"','',@SW_HIDE,6)
ProcessWaitClose($iPID)
ConsoleWrite(StdoutRead($iPID) & @CRLF)

 

 

Saludos

Posted (edited)

Thanks for the help Danyfirex but you changed your reply afterwards...I was replying to your initial answer. The first suggestion  of your modified reply works: adding the ampersand. Second one does not. Second one works too !

Edit: must have made a typo somewhere first time around...sorry 😓

Edited by lowrider2025

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...