UtilPowerShellExecutePowerShellCommand(String, IList, String) Method
Executes the specified PowerShell command and returns the execution results.
Namespace: DevCase.Core.Diagnostics.PowerShellAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static Collection<PSObject> ExecutePowerShellCommand(
string command,
IList parameters,
params string[] importModules
)
Public Shared Function ExecutePowerShellCommand (
command As String,
parameters As IList,
ParamArray importModules As String()
) As Collection(Of PSObject)
Dim command As String
Dim parameters As IList
Dim importModules As String()
Dim returnValue As Collection(Of PSObject)
returnValue = UtilPowerShell.ExecutePowerShellCommand(command,
parameters, importModules)
public:
static Collection<PSObject^>^ ExecutePowerShellCommand(
String^ command,
IList^ parameters,
... array<String^>^ importModules
)
static member ExecutePowerShellCommand :
command : string *
parameters : IList *
importModules : string[] -> Collection<PSObject>
No code example is currently available or this language may not be supported.
- command String
-
The PowerShell command to execute.
- parameters IList
-
A list of parameter names.
- importModules String
-
Specifies PowerShell's module names to import.
CollectionPSObject
A
CollectionT object that represents the command execution results.
This is a code example.
No code example is currently available or this language may not be supported.
Dim importModules As String() = {"Dism"}
Dim command As String = "Get-WindowsDriver"
Dim parameters As New List(Of String) From {"Online", "All"}
' Script: "Get-WindowsDriver -Online -All"
Dim results As Collection(Of PSObject) = ExecutePowerShellCommand(command, parameters, importModules)
Debug.WriteLine(results.First().Properties("OriginalFilename").Value)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.