Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: RunSpace10 Code Sample
# RunSpace10 Code Sample

Here is the source code for the Runspace10 sample. This sample application adds a cmdlet to
[System.Management.Automation.Runspaces.Runspaceconfiguration](/dotnet/api/System.Management.Automation.Runspaces.RunspaceConfiguration)
[System.Management.Automation.Runspaces.RunspaceConfiguration](/dotnet/api/System.Management.Automation.Runspaces.RunspaceConfiguration)
and then uses the modified configuration information to create the runspace.

> [!NOTE]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Namespace Microsoft.Samples.PowerShell.Commands
#Region "StopProcCommand"

''' <summary>
''' Class that implements the stop-proc cmdlet.
''' Class that implements the Stop-Proc cmdlet.
''' </summary>
<Cmdlet(VerbsLifecycle.Stop, "Proc", DefaultParameterSetName:="ProcessId", _
SupportsShouldProcess:=True)> _
Expand Down Expand Up @@ -454,7 +454,7 @@ ContinueForEach1:
Public Overrides ReadOnly Property Description() As String
Get
Return "This is a PowerShell snap-in that includes " & _
"the stop-proc cmdlet."
"the Stop-Proc cmdlet."
End Get
End Property
End Class 'StopProcPSSnapIn04
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PowerShell runtime processes all command types just as it does cmdlets, using pi

In addition to commands, Windows PowerShell supports various customizable Windows PowerShell
providers that make available specific sets of cmdlets. The shell operates within the Windows
PowerShell-provided host application (Windows PowerShell.exe), but it is equally accessible from a
PowerShell-provided host application (`powershell.exe`), but it is equally accessible from a
custom host application that you can develop to meet specific requirements. For more information,
see [How Windows PowerShell Works](/previous-versions//ms714658(v=vs.85)).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ code that is contained in the Windows SDK samples.
| [StopProc01 Code Samples](./stopproc01-code-samples.md) | This is the `Stop-Process` cmdlet sample described in [Creating a Cmdlet That Modifies the System](../cmdlet/creating-a-cmdlet-that-modifies-the-system.md). |
| [StopProcessSample04 Code Samples](./stopprocesssample04-code-samples.md) | This is the `Stop-Process` cmdlet sample described in [Adding Parameter Sets to a Cmdlet](../cmdlet/adding-parameter-sets-to-a-cmdlet.md). |
| [Runspace01 Code Samples](./runspace01-code-samples.md) | These are the code samples for the runspace described in [Creating a Console Application That Runs a Specified Command](/dotnet/csharp/programming-guide/inside-a-program/hello-world-your-first-program). |
| [Runspace02 Code Samples](./runspace02-code-samples.md) | This sample uses the [System.Management.Automation.Runspaceinvoke](/dotnet/api/System.Management.Automation.RunspaceInvoke) class to execute the `Get-Process` cmdlet synchronously. |
| [Runspace02 Code Samples](./runspace02-code-samples.md) | This sample uses the [System.Management.Automation.RunspaceInvoke](/dotnet/api/System.Management.Automation.RunspaceInvoke) class to execute the `Get-Process` cmdlet synchronously. |
| [RunSpace03 Code Samples](./runspace03-code-samples.md) | These are the code samples for the runspace described in "Creating a Console Application That Runs a Specified Script". |
| [RunSpace04 Code Samples](./runspace04-code-samples.md) | This is a code sample for a runspace that uses the [System.Management.Automation.Runspaceinvoke](/dotnet/api/System.Management.Automation.RunspaceInvoke) class to execute a script that generates a terminating error. |
| [RunSpace04 Code Samples](./runspace04-code-samples.md) | This is a code sample for a runspace that uses the [System.Management.Automation.RunspaceInvoke](/dotnet/api/System.Management.Automation.RunspaceInvoke) class to execute a script that generates a terminating error. |
| [RunSpace05 Code Sample](./runspace05-code-sample.md) | |
| [RunSpace06 Code Sample](./runspace06-code-sample.md) | |
| [RunSpace07 Code Sample](./runspace07-code-sample.md) | |
| [RunSpace08 Code Sample](./runspace08-code-sample.md) | |
| [RunSpace09 Code Sample](./runspace09-code-sample.md) | |
| [RunSpace10 Code Sample](./runspace10-code-sample.md) | This is the source code for the Runspace10 sample, which adds a cmdlet to [System.Management.Automation.Runspaces.Runspaceconfiguration](/dotnet/api/System.Management.Automation.Runspaces.RunspaceConfiguration) and then uses the modified configuration information to create the runspace. |
| [RunSpace10 Code Sample](./runspace10-code-sample.md) | This is the source code for the Runspace10 sample, which adds a cmdlet to [System.Management.Automation.Runspaces.RunspaceConfiguration](/dotnet/api/System.Management.Automation.Runspaces.RunspaceConfiguration) and then uses the modified configuration information to create the runspace. |

## See Also

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: AccessDBProviderSample01
# AccessDBProviderSample01

This sample shows how to declare a provider class that derives directly from the
[System.Management.Automation.Provider.Cmdletprovider](/dotnet/api/System.Management.Automation.Provider.CmdletProvider)
[System.Management.Automation.Provider.CmdletProvider](/dotnet/api/System.Management.Automation.Provider.CmdletProvider)
class. It is included here only for completeness.

## Demonstrates
Expand All @@ -16,9 +16,9 @@ class. It is included here only for completeness.
> Your provider class will most likely derive from one of the following classes and possibly
> implement other provider interfaces:
>
> - [System.Management.Automation.Provider.Itemcmdletprovider](/dotnet/api/System.Management.Automation.Provider.ItemCmdletProvider) class. See [AccessDBProviderSample03](./accessdbprovidersample03.md).
> - [System.Management.Automation.Provider.Containercmdletprovider](/dotnet/api/System.Management.Automation.Provider.ContainerCmdletProvider) class. See [AccessDBProviderSample04](./accessdbprovidersample04.md).
> - [System.Management.Automation.Provider.Navigationcmdletprovider](/dotnet/api/System.Management.Automation.Provider.NavigationCmdletProvider) class. See [AccessDBProviderSample05](./accessdbprovidersample05.md).
> - [System.Management.Automation.Provider.ItemCmdletProvider](/dotnet/api/System.Management.Automation.Provider.ItemCmdletProvider) class. See [AccessDBProviderSample03](./accessdbprovidersample03.md).
> - [System.Management.Automation.Provider.ContainerCmdletProvider](/dotnet/api/System.Management.Automation.Provider.ContainerCmdletProvider) class. See [AccessDBProviderSample04](./accessdbprovidersample04.md).
> - [System.Management.Automation.Provider.NavigationCmdletProvider](/dotnet/api/System.Management.Automation.Provider.NavigationCmdletProvider) class. See [AccessDBProviderSample05](./accessdbprovidersample05.md).
>
> For more information about choosing which provider class to derive from based on provider
> features, see [Designing Your Windows PowerShell Provider](./provider-types.md).
Expand All @@ -28,7 +28,7 @@ This sample demonstrates the following:
- Declaring the `CmdletProvider` attribute.

- Defining a provider class that derives directly from the
[System.Management.Automation.Provider.Cmdletprovider](/dotnet/api/System.Management.Automation.Provider.CmdletProvider)
[System.Management.Automation.Provider.CmdletProvider](/dotnet/api/System.Management.Automation.Provider.CmdletProvider)
class.

## Example
Expand All @@ -39,10 +39,10 @@ This sample shows how to define a provider class and how to declare the `CmdletP

## See Also

[System.Management.Automation.Provider.Itemcmdletprovider](/dotnet/api/System.Management.Automation.Provider.ItemCmdletProvider)
[System.Management.Automation.Provider.ItemCmdletProvider](/dotnet/api/System.Management.Automation.Provider.ItemCmdletProvider)

[System.Management.Automation.Provider.Containercmdletprovider](/dotnet/api/System.Management.Automation.Provider.ContainerCmdletProvider)
[System.Management.Automation.Provider.ContainerCmdletProvider](/dotnet/api/System.Management.Automation.Provider.ContainerCmdletProvider)

[System.Management.Automation.Provider.Navigationcmdletprovider](/dotnet/api/System.Management.Automation.Provider.NavigationCmdletProvider)
[System.Management.Automation.Provider.NavigationCmdletProvider](/dotnet/api/System.Management.Automation.Provider.NavigationCmdletProvider)

[Designing Your Windows PowerShell Provider](./provider-types.md)
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ title: AccessDBProviderSample02
# AccessDBProviderSample02

This sample shows how to overwrite the
[System.Management.Automation.Provider.Drivecmdletprovider.Newdrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.NewDrive)
[System.Management.Automation.Provider.DriveCmdletProvider.NewDrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.NewDrive)
and
[System.Management.Automation.Provider.Drivecmdletprovider.Removedrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive)
[System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive)
methods to support calls to the `New-PSDrive` and `Remove-PSDrive` cmdlets. The provider class in
this sample derives from the
[System.Management.Automation.Provider.Drivecmdletprovider](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider)
[System.Management.Automation.Provider.DriveCmdletProvider](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider)
class.

## Demonstrates
Expand All @@ -21,9 +21,9 @@ class.
> Your provider class will most likely derive from one of the following classes and possibly
> implement other provider interfaces:
>
> - [System.Management.Automation.Provider.Itemcmdletprovider](/dotnet/api/System.Management.Automation.Provider.ItemCmdletProvider) class. See [AccessDBProviderSample03](./accessdbprovidersample03.md).
> - [System.Management.Automation.Provider.Containercmdletprovider](/dotnet/api/System.Management.Automation.Provider.ContainerCmdletProvider) class. See [AccessDBProviderSample04](./accessdbprovidersample04.md).
> - [System.Management.Automation.Provider.Navigationcmdletprovider](/dotnet/api/System.Management.Automation.Provider.NavigationCmdletProvider) class. See [AccessDBProviderSample05](./accessdbprovidersample05.md).
> - [System.Management.Automation.Provider.ItemCmdletProvider](/dotnet/api/System.Management.Automation.Provider.ItemCmdletProvider) class. See [AccessDBProviderSample03](./accessdbprovidersample03.md).
> - [System.Management.Automation.Provider.ContainerCmdletProvider](/dotnet/api/System.Management.Automation.Provider.ContainerCmdletProvider) class. See [AccessDBProviderSample04](./accessdbprovidersample04.md).
> - [System.Management.Automation.Provider.NavigationCmdletProvider](/dotnet/api/System.Management.Automation.Provider.NavigationCmdletProvider) class. See [AccessDBProviderSample05](./accessdbprovidersample05.md).
>
> For more information about choosing which provider class to derive from based on provider
> features, see [Designing Your Windows PowerShell Provider](./provider-types.md).
Expand All @@ -33,35 +33,35 @@ This sample demonstrates the following:
- Declaring the `CmdletProvider` attribute.

- Defining a provider class that drives from the
[System.Management.Automation.Provider.Drivecmdletprovider](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider)
[System.Management.Automation.Provider.DriveCmdletProvider](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider)
class.

- Overwriting the
[System.Management.Automation.Provider.Drivecmdletprovider.Newdrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.NewDrive)
[System.Management.Automation.Provider.DriveCmdletProvider.NewDrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.NewDrive)
method to support creating new drives. (This sample does not show how to add dynamic parameters to
the `New-PSDrive` cmdlet.)

- Overwriting the
[System.Management.Automation.Provider.Drivecmdletprovider.Removedrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive)
[System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive)
method to support removing existing drives.

## Example

This sample shows how to overwrite the
[System.Management.Automation.Provider.Drivecmdletprovider.Newdrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.NewDrive)
[System.Management.Automation.Provider.DriveCmdletProvider.NewDrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.NewDrive)
and
[System.Management.Automation.Provider.Drivecmdletprovider.Removedrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive)
[System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive*](/dotnet/api/System.Management.Automation.Provider.DriveCmdletProvider.RemoveDrive)
methods. For this sample provider, when a drive is created its connection information is stored in
an `AccessDBPsDriveInfo` object.

:::code language="csharp" source="~/../powershell-sdk-samples/SDK-2.0/csharp/AccessDBProviderSample02/AccessDBProviderSample02.cs" range="11-154":::

## See Also

[System.Management.Automation.Provider.Itemcmdletprovider](/dotnet/api/System.Management.Automation.Provider.ItemCmdletProvider)
[System.Management.Automation.Provider.ItemCmdletProvider](/dotnet/api/System.Management.Automation.Provider.ItemCmdletProvider)

[System.Management.Automation.Provider.Containercmdletprovider](/dotnet/api/System.Management.Automation.Provider.ContainerCmdletProvider)
[System.Management.Automation.Provider.ContainerCmdletProvider](/dotnet/api/System.Management.Automation.Provider.ContainerCmdletProvider)

[System.Management.Automation.Provider.Navigationcmdletprovider](/dotnet/api/System.Management.Automation.Provider.NavigationCmdletProvider)
[System.Management.Automation.Provider.NavigationCmdletProvider](/dotnet/api/System.Management.Automation.Provider.NavigationCmdletProvider)

[Designing Your Windows PowerShell Provider](./provider-types.md)
Loading