diff --git a/README.md b/README.md index ea9554087c4d..55be2ece7f1d 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Each folder in this repo publishes to [MSDN](https://msdn.microsoft.com/en-us/po * [/dsc/](https://msdn.microsoft.com/en-us/powershell/dsc/) is for the Desired State Configuration feature * [/gallery/](https://msdn.microsoft.com/powershell/gallery) is for the [PowerShell Gallery](https://www.powershellgallery.com/) * [/jea/](https://msdn.microsoft.com/powershell/jea/) is for the Just Enough Administration feature -* [/reference/](https://msdn.microsoft.com/powershell/reference/) is for PowerShell module reference across versions 2.0, 3.0, 4.0, 5.0, 5.1, and 6.0 +* [/reference/](https://msdn.microsoft.com/powershell/reference/) is for PowerShell module reference across versions 3.0, 4.0, 5.0, 5.1, and 6.0 * This content will be retrieved by the `Get-Help` cmdlet in the future * [/scripting/](https://msdn.microsoft.com/en-us/powershell/scripting/) is general PowerShell reference content * [/wmf](https://msdn.microsoft.com/en-us/powershell/wmf/readme) contains release notes for the Windows Management Framework, the package used to distribute new versions of PowerShell to previous versions of Windows. diff --git a/reference/3.0/Microsoft.PowerShell.Utility/Add-Type.md b/reference/3.0/Microsoft.PowerShell.Utility/Add-Type.md index 12bb393b8d1b..6506a89f2f01 100644 --- a/reference/3.0/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/3.0/Microsoft.PowerShell.Utility/Add-Type.md @@ -157,18 +157,18 @@ The wildcard character allows you to get the correct assembly even when you are The command uses the **PassThru** parameter to generate objects that represent the classes that are added to the session, and it saves the objects in the $accType variable. ### Example 4 ``` -PS C:\> Add-Type -Path c:\ps-test\Hello.vb -[VBFromFile]::SayHello(", World") +PS C:\> Add-Type -Path "c:\ps-test\Hello.vb" +PS C:\> [VBFromFile]::SayHello(", World") # From Hello.vb Public Class VBFromFile -Public Shared Function SayHello(sourceName As String) As String -Dim myValue As String = "Hello" -return myValue + sourceName -End Function + Public Shared Function SayHello(sourceName As String) As String + Dim myValue As String = "Hello" + return myValue + sourceName + End Function End Class -PS C:\> [VBFromFile]::SayHello(", World") + Hello, World ``` diff --git a/reference/4.0/Microsoft.PowerShell.Utility/Add-Type.md b/reference/4.0/Microsoft.PowerShell.Utility/Add-Type.md index 96b463d9aa55..de5836970ef3 100644 --- a/reference/4.0/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/4.0/Microsoft.PowerShell.Utility/Add-Type.md @@ -164,12 +164,19 @@ The command uses the **PassThru** parameter to generate objects that represent t ### Example 4 ``` -PS C:\> Add-Type -Path c:\ps-test\Hello.vb[VBFromFile]::SayHello(", World") +PS C:\> Add-Type -Path "c:\ps-test\Hello.vb" +PS C:\> [VBFromFile]::SayHello(", World") # From Hello.vb -Public Class VBFromFilePublic Shared Function SayHello(sourceName As String) As StringDim myValue As String = "Hello"return myValue + sourceNameEnd FunctionEnd Class -PS C:\> [VBFromFile]::SayHello(", World")Hello, World +Public Class VBFromFile + Public Shared Function SayHello(sourceName As String) As String + Dim myValue As String = "Hello" + return myValue + sourceName + End Function +End Class + +Hello, World ``` This example uses the **Add-Type** cmdlet to add the VBFromFile class that is defined in the Hello.vb file to the current session. diff --git a/reference/5.0/Microsoft.PowerShell.Utility/Add-Type.md b/reference/5.0/Microsoft.PowerShell.Utility/Add-Type.md index 0a03df70a84b..e6cd5b58c4b6 100644 --- a/reference/5.0/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/5.0/Microsoft.PowerShell.Utility/Add-Type.md @@ -160,9 +160,15 @@ The command uses the *PassThru* parameter to generate objects that represent the ``` PS C:\> Add-Type -Path "c:\ps-test\Hello.vb" PS C:\> [VBFromFile]::SayHello(", World") + # From Hello.vb -Public Class VBFromFilePublic Shared Function SayHello(sourceName As String) As String Dim myValue As String = "Hello" return myValue + sourceName End Function End Class +Public Class VBFromFile + Public Shared Function SayHello(sourceName As String) As String + Dim myValue As String = "Hello" + return myValue + sourceName + End Function +End Class Hello, World ``` diff --git a/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md b/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md index a5e37c896c99..d0f2892f3f2c 100644 --- a/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/5.1/Microsoft.PowerShell.Utility/Add-Type.md @@ -160,9 +160,15 @@ The command uses the *PassThru* parameter to generate objects that represent the ``` PS C:\> Add-Type -Path "c:\ps-test\Hello.vb" PS C:\> [VBFromFile]::SayHello(", World") + # From Hello.vb -Public Class VBFromFilePublic Shared Function SayHello(sourceName As String) As String Dim myValue As String = "Hello" return myValue + sourceName End Function End Class +Public Class VBFromFile + Public Shared Function SayHello(sourceName As String) As String + Dim myValue As String = "Hello" + return myValue + sourceName + End Function +End Class Hello, World ``` diff --git a/reference/6/Microsoft.PowerShell.Utility/Add-Type.md b/reference/6/Microsoft.PowerShell.Utility/Add-Type.md index 1c198214c223..6751ed0dad64 100644 --- a/reference/6/Microsoft.PowerShell.Utility/Add-Type.md +++ b/reference/6/Microsoft.PowerShell.Utility/Add-Type.md @@ -161,9 +161,15 @@ The command uses the *PassThru* parameter to generate objects that represent the ``` PS C:\> Add-Type -Path "c:\ps-test\Hello.vb" PS C:\> [VBFromFile]::SayHello(", World") + # From Hello.vb -Public Class VBFromFilePublic Shared Function SayHello(sourceName As String) As String Dim myValue As String = "Hello" return myValue + sourceName End Function End Class +Public Class VBFromFile + Public Shared Function SayHello(sourceName As String) As String + Dim myValue As String = "Hello" + return myValue + sourceName + End Function +End Class Hello, World ```