Questions tagged [powershell-sdk]

This tag is useful when the issue pertains to the development and maintenance of Powershell extends which use the generic Powershell Software Development Kit, as opposed to a provider-specific SDK.

The Windows PowerShell Software Development Kit (SDK) is written for command developers who require reference information about the APIs provided by Windows PowerShell. Command developers use Windows PowerShell to create both commands and providers that extend the tasks that can be performed by Windows PowerShell.

35 questions
0
votes
1 answer

.Net Powershell SDK 6.2.6 - Why are PKI module commands unavailable on some systems?

The short question Why, when I run the Get-Command powershell command within a .NET 5.0 application using the Microsoft.PowerShell.SDK nuget package I get different results on different systems, and those results are different to running the same…
GPW
  • 2,528
  • 1
  • 10
  • 22
0
votes
0 answers

IIS 10.0 Could not connect to NuGet feed via PowerShell

I am doing an automatic build of C# applications on a web server with IIS 10.0, my code generates a command for PowerShell.SDK. using(PowerShell pws = PowerShell.Create()) { var cmd = $"set-location \"{slnDirectory}\""; cmd +=…
0
votes
0 answers

The term is not recognized as a cmdlet, function, operable program, or script file

I am trying to execute powershell commands on remote machine using the following code: string shellUri = "http://schemas.microsoft.com/powershell/Microsoft.PowerShell"; PSCredential remoteCredential = new PSCredential("User",…
0
votes
1 answer

C# PowerShell does not capture PowerShell.Streams when using AddCommand but does when using AddScript

I am encountering a very strange behavior when using PowerShell in C#. When I execute InitialSessionState s = InitialSessionState.CreateDefault2(); var ps = PowerShell.Create(s); ps.AddCommand("Write-Information") .AddArgument("") …
Börg
  • 532
  • 1
  • 4
  • 13
-1
votes
2 answers

Capturing all streams in correct sequence with PowerShell SDK

I'm executing a script with the PowerShell SDK, which makes use of all different streams (information, warning, verbose, ..). I can capture the output from them correctly, but not in the sequence they are generated. As an example, here is a console…
Thomas Glaser
  • 1,670
  • 1
  • 18
  • 26
1 2
3