Search notes:

System.Management.Automation.PowerShell (class)

System.Management.Automation.PowerShell is used to host Windows PowerShell in an application.
System.Management.Automation.PowerShell represents a PowerShell command or PowerShell script.
This class provides methods that create a pipeline of commands and then execute those commands in a runspace.

Constructor

The constructor

Properties, Methods and events

`AddArgument()
`AddCommand()
`AddParameter()
`AddParameters()
`AddScript()
`AddStatement()
`BeginInvoke()
`BeginStop()
`Commands
`Connect()
`ConnectAsync()
`Create()
`CreateNestedPowerShell()
`Dispose()
`EndInvoke()
`EndStop()
`GetSteppablePipeline()
`HadErrors
`HistoryString
`InstanceId
`InvocationStateChanged() Event
`InvocationStateInfo
`Invoke()
`InvokeAsync()
`IsNested
`IsRunspaceOwner
`Runspace
`RunspacePool
`Stop()
`StopAsync()
`Streams

AddScript()

[PowerShell] $ps = [PowerShell]::Create()
$scr = $ps.AddScript("$pwd\the-script.ps1")
$res = $scr.Invoke()

See also

PowerShell defines a type accelerator for this class which simply is [PowerShell].

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1788375072, '216.73.217.21', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/dot-net/namespaces-classes/System/Management/Automation/PowerShell(93): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78