diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Add-LocalGroupMember.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Add-LocalGroupMember.md deleted file mode 100644 index 5a12c590c3fa..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Add-LocalGroupMember.md +++ /dev/null @@ -1,179 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822507 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Add-LocalGroupMember ---- - -# Add-LocalGroupMember - -## SYNOPSIS -Adds members to a local group. - -## SYNTAX - -### Group -``` -Add-LocalGroupMember [-Group] [-Member] [-WhatIf] [-Confirm] - [] -``` - -### Default -``` -Add-LocalGroupMember [-Member] [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Add-LocalGroupMember [-Member] [-SID] [-WhatIf] [-Confirm] - [] -``` - -## DESCRIPTION -The **Add-LocalGroupMember** cmdlet adds users or groups to a local security group. -All the rights and permissions that are assigned to a group are assigned to all members of that group. - -Members of the Administrators group on a local computer have Full Control permissions on that computer. -Limit the number of users in the Administrators group. - -If the computer is joined to a domain, you can add user accounts, computer accounts, and group accounts from that domain and from trusted domains to a local group. - -## EXAMPLES - -### Example 1: Add members to the Administrators group -``` -PS C:\> Add-LocalGroupMember -Group "Administrators" -Member "Admin02", "MicrosoftAccount\username@Outlook.com", "AzureAD\DavidChew@contoso.com", "CONTOSO\Domain Admins" -``` - -This command adds several members to the local Administrators group. -The new members include a local user account, a Microsoft account, an Azure Active Directory account, and a domain group. -This example uses a placeholder value for the user name of an account at Outlook.com. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Group -Specifies the security group to which this cmdlet adds members. - -```yaml -Type: LocalGroup -Parameter Sets: Group -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Member -Specifies an array of users or groups that this cmdlet adds to a security group. -You can specify users or groups by name, security ID (SID), or **LocalPrincipal** objects. - -```yaml -Type: LocalPrincipal[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group to which this cmdlet adds members. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID of the security group to which this cmdlet adds members. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local principal, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroupMember](Get-LocalGroupMember.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroupMember](Remove-LocalGroupMember.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Disable-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Disable-LocalUser.md deleted file mode 100644 index 8199883c16c3..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Disable-LocalUser.md +++ /dev/null @@ -1,170 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822508 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Disable-LocalUser ---- - -# Disable-LocalUser - -## SYNOPSIS -Disables a local user account. - -## SYNTAX - -### InputObject -``` -Disable-LocalUser [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Disable-LocalUser [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Disable-LocalUser [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Disable-LocalUser** cmdlet disables local user accounts. -When a user account is disabled, the user cannot log on. -When a user account is enabled, the user can log on. - -## EXAMPLES - -### Example 1: Disable an account by specifying a name -``` -PS C:\> Disable-LocalUser -Name "Admin02" -``` - -This command disables the user account named Admin02. - -### Example 2: Disable an account by using the pipeline -``` -PS C:\> Get-LocalUser Guest | Disable-LocalUser -``` - -This command gets the built-in Guest account by using **Get-LocalUser**, and then passes it to the current cmdlet by using the pipeline operator. -That cmdlet disables that account. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies an array of user accounts that this cmdlet disables. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser[] -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies an array of names of the user accounts that this cmdlet disables. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of user accounts that this cmdlet disables. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Enable-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Enable-LocalUser.md deleted file mode 100644 index 513afc222907..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Enable-LocalUser.md +++ /dev/null @@ -1,170 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822510 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Enable-LocalUser ---- - -# Enable-LocalUser - -## SYNOPSIS -Enables a local user account. - -## SYNTAX - -### InputObject -``` -Enable-LocalUser [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Enable-LocalUser [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Enable-LocalUser [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Enable-LocalUser** cmdlet enables local user accounts. -When a user account is disabled, the user cannot log on. -When a user account is enabled, the user can log on. - -## EXAMPLES - -### Example 1: Enable an account by specifying a name -``` -PS C:\> Enable-LocalUser -Name "Admin02" -``` - -This command enables the user account named Admin02. - -### Example 2: Enable an account by using the pipeline -``` -PS C:\> Get-LocalUser -Name "Administrator" | Enable-LocalUser -``` - -This command gets the built-in Administrator account by using **Get-LocalUser**, and then passes it to the current cmdlet by using the pipeline operator. -That cmdlet enables that account. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies an array of user accounts that this cmdlet enables. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser[] -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies an array of names of the user accounts that this cmdlet enables. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of user accounts that this cmdlet enables. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroup.md deleted file mode 100644 index 4f33f8d9a6fb..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroup.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822511 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Get-LocalGroup ---- - -# Get-LocalGroup - -## SYNOPSIS -Gets the local security groups. - -## SYNTAX - -### Default (Default) -``` -Get-LocalGroup [[-Name] ] [] -``` - -### SecurityIdentifier -``` -Get-LocalGroup [[-SID] ] [] -``` - -## DESCRIPTION -The **Get-LocalGroup** cmdlet gets local security groups in Security Account Manager. -This cmdlet gets default built-in groups and local security groups that you create. - -## EXAMPLES - -### Example 1: Get the Administrators group -``` -PS C:\> Get-LocalGroup -Name "Administrators" -Name Description ----- ----------- -Administrators Administrators have complete and unrestricted access to the computer/domain -``` - -This command gets the local Administrators group. -The command displays properties of the group in the console. - -## PARAMETERS - -### -Name -Specifies an array of names of security groups that this cmdlet gets. -You can use the wildcard character. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of security IDs (SIDs) of security groups that this cmdlet gets. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String, System.Security.Principal.SecurityIdentifier -You can pipe a string or a SID to this cmdlet. - -## OUTPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup -This cmdlet returns a local group. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroup](Remove-LocalGroup.md) - -[Rename-LocalGroup](Rename-LocalGroup.md) - -[Set-LocalGroup](Set-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroupMember.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroupMember.md deleted file mode 100644 index 05f3ead03de3..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalGroupMember.md +++ /dev/null @@ -1,147 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822512 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Get-LocalGroupMember ---- - -# Get-LocalGroupMember - -## SYNOPSIS -Gets members from a local group. - -## SYNTAX - -### Default (Default) -``` -Get-LocalGroupMember [[-Member] ] [-Name] [] -``` - -### Group -``` -Get-LocalGroupMember [-Group] [[-Member] ] [] -``` - -### SecurityIdentifier -``` -Get-LocalGroupMember [[-Member] ] [-SID] [] -``` - -## DESCRIPTION -The **Get-LocalGroupMember** cmdlet gets members from a local group. - -## EXAMPLES - -### Example 1: Get all members of the Administrators group -``` -PS C:\> Get-LocalGroupMember -Group "Administrators" -ObjectClass Name PrincipalSource ------------ ---- --------------- -User CONTOSOPC\Administrator Local -User CONTOSOPC\LocalAdmin Local -``` - -This command gets all the members of the local Administrators group. - -## PARAMETERS - -### -Group -Specifies the security group from which this cmdlet gets members. - -```yaml -Type: LocalGroup -Parameter Sets: Group -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Member -Specifies a user or group that this cmdlet gets from a security group. -You can specify users or groups by name or security ID (SID). -Specify SID strings in S-R-I-S-S . -. . -format. -You can use wildcard characters. -If you do not specify this parameter, the cmdlet gets all members of the group. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group from which this cmdlet gets members. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID of the security group from which this cmdlet gets members. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local group, a string, or a SID to this cmdlet. - -## OUTPUTS - -### Microsoft.SecurityAccountsManager.LocalPrincipal -This cmdlet returns local principals. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Add-LocalGroupMember](Add-LocalGroupMember.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroupMember](Remove-LocalGroupMember.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalUser.md deleted file mode 100644 index a07c2f4dc537..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Get-LocalUser.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822514 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Get-LocalUser ---- - -# Get-LocalUser - -## SYNOPSIS -Gets local user accounts. - -## SYNTAX - -### Default (Default) -``` -Get-LocalUser [[-Name] ] [] -``` - -### SecurityIdentifier -``` -Get-LocalUser [[-SID] ] [] -``` - -## DESCRIPTION -The **Get-LocalUser** cmdlet gets local user accounts. -This cmdlet gets default built-in user accounts, local user accounts that you created, and local accounts that you connected to Microsoft accounts. - -## EXAMPLES - -### Example 1: Get an account by using its name -``` -PS C:\> Get-LocalUser -Name "AdminContoso02" -Name Enabled Description ----- ------- ----------- -AdminContoso02 True Description of this account. -``` - -This command gets a user account named AdminContoso02. - -### Example 2: Get an account that is connected to a Microsoft account -``` -PS C:\> Get-LocalUser -Name "MicrosoftAccount\username@Outlook.com" -Name Enabled Description ----- ------- ----------- -MicrosoftAccount\user name@outlook.com True Description of this account. -``` - -This command gets a user account that is connected to a Microsoft account. -This example uses a placeholder value for the user name of an account at Outlook.com. - -### Example 3: Get an account that is connected to a Microsoft account -``` -PS C:\> Get-LocalUser -SecurityIdentifier "S-1-5-2" -Name Enabled Description ----- ------- ----------- -MicrosoftAccount\user name@contoso.com True Description of this account. -``` - -This command gets a local user account that has the specified SID. - -## PARAMETERS - -### -Name -Specifies an array of names of user accounts that this cmdlet gets. -You can use the wildcard character. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of security IDs (SIDs) of user accounts that this cmdlet gets. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String, System.Security.Principal.SecurityIdentifier -You can pipe a string or SID to this cmdlet. - -## OUTPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser[] -This cmdlet returns local user accounts. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.md deleted file mode 100644 index 69f69afe3e2f..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-US -keywords: powershell,cmdlet -Help Version: 6.0 -Download Help Link: http://Please-enter-FwLink-manually -Module Guid: 8e362604-2c0b-448f-a414-a6a690a644e2 -title: Microsoft.PowerShell.LocalAccounts -Module Name: Microsoft.PowerShell.LocalAccounts ---- - -# Microsoft.PowerShell.LocalAccounts Module -## Description -This section contains the help topics for the Local Accounts cmdlets in Windows PowerShell. - -## Microsoft.PowerShell.LocalAccounts Cmdlets -### [Add-LocalGroupMember](Add-LocalGroupMember.md) -Adds members to a local group. - - -### [Disable-LocalUser](Disable-LocalUser.md) -Disables a local user account. - - -### [Enable-LocalUser](Enable-LocalUser.md) -Enables a local user account. - - -### [Get-LocalGroup](Get-LocalGroup.md) -Gets the local security groups. - - -### [Get-LocalGroupMember](Get-LocalGroupMember.md) -Gets members from a local group. - - -### [Get-LocalUser](Get-LocalUser.md) -Gets local user accounts. - - -### [New-LocalGroup](New-LocalGroup.md) -Creates a local security group. - - -### [New-LocalUser](New-LocalUser.md) -Creates a local user account. - - -### [Remove-LocalGroup](Remove-LocalGroup.md) -Deletes local security groups. - - -### [Remove-LocalGroupMember](Remove-LocalGroupMember.md) -Removes members from a local group. - - -### [Remove-LocalUser](Remove-LocalUser.md) -Deletes local user accounts. - - -### [Rename-LocalGroup](Rename-LocalGroup.md) -Renames a local security group. - - -### [Rename-LocalUser](Rename-LocalUser.md) -Renames a local user account. - - -### [Set-LocalGroup](Set-LocalGroup.md) -Changes a local security group. - - -### [Set-LocalUser](Set-LocalUser.md) -Modifies a local user account. diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md deleted file mode 100644 index a43f56baa414..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalGroup.md +++ /dev/null @@ -1,131 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822515 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: New-LocalGroup ---- - -# New-LocalGroup - -## SYNOPSIS -Creates a local security group. - -## SYNTAX - -``` -New-LocalGroup [-Description ] [-Name] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **New-LocalGroup** cmdlet creates a local security group in the Security Account Manager. - -## EXAMPLES - -### Example 1: Create a security group -``` -PS C:\> New-LocalGroup -Name "SecurityGroup04" -``` - -This command creates a group named SecurityGroup04. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Description -Specifies a comment for the group. -The maximum length is 48 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Name -Specifies a name for the group. -The maximum length is 256 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String -You can pipe a string to this cmdlet. - -## OUTPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup -This cmdlet returns a security group. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroup](Get-LocalGroup.md) - -[Remove-LocalGroup](Remove-LocalGroup.md) - -[Rename-LocalGroup](Rename-LocalGroup.md) - -[Set-LocalGroup](Set-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalUser.md deleted file mode 100644 index d3a89f15fea1..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/New-LocalUser.md +++ /dev/null @@ -1,315 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822516 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: New-LocalUser ---- - -# New-LocalUser - -## SYNOPSIS -Creates a local user account. - -## SYNTAX - -### Password (Default) -``` -New-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-Disabled] - [-FullName ] [-Name] -Password [-PasswordNeverExpires] - [-UserMayNotChangePassword] [-WhatIf] [-Confirm] [] -``` - -### NoPassword -``` -New-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-Disabled] - [-FullName ] [-Name] [-NoPassword] [-UserMayNotChangePassword] [-WhatIf] [-Confirm] - [] -``` - -## DESCRIPTION -The **New-LocalUser** cmdlet creates a local user account. -This cmdlet creates a local user account or a local user account that is connected to a Microsoft account. - -## EXAMPLES - -### Example 1: Create a user account -``` -PS C:\> New-LocalUser -Name "User02" -Description "Description of this account." -NoPassword -Name Enabled Description ----- ------- ----------- -User02 True Description of this account. -``` - -This command creates a local user account. -The command does not specify the *AccountExpires* parameter. -Therefore, the account does not expire. - -### Example 2: Create a user account that has a password -``` -PS C:\> $Password = Read-Host -AsSecureString -PS C:\> New-LocalUser "User03" -Password $Password -FullName "Third User" -Description "Description of this account." -Name Enabled Description ----- ------- ----------- -User03 True Description of this account. -``` - -The first command prompts you for a password by using the Read-Host cmdlet. -The command stores the password as a secure string in the $Password variable. - -The second command creates a local user account by using the password stored in $Password. -The command specifies a user name, full name, and description for the user account. - -### Example 3: Create a user account that is connected to a Microsoft account -``` -PS C:\> New-LocalUser -Name "MicrosoftAccount\usr name@Outlook.com" -Description "Description of this account." -``` - -This command creates a local user account that is connected to a Microsoft account. -This example uses a placeholder value for the user name of an account at Outlook.com. -Because the account is connected to a Microsoft account, do not specify a password. - -## PARAMETERS - -### -AccountExpires -Specifies when the user account expires. -To obtain a **DateTime** object, use the Get-Date cmdlet. -If you do not specify this parameter, the account does not expire. - -```yaml -Type: DateTime -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -AccountNeverExpires -Indicates that the account does not expire. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Description -Specifies a comment for the user account. -The maximum length is 48 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Disabled -Indicates that this cmdlet creates the user account as disabled. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -FullName -Specifies the full name for the user account. -The full name differs from the user name of the user account. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Name -Specifies the user name for the user account. - -If you create a local user account that is connected to a Microsoft account, specify the user name in the following format: `MicrosoftAccount\\`\@`Outlook.com` for a user of a Microsoft account on Outlook.com. - -If you create a local user account for the local system, the user name can contain up to 20 uppercase characters or lowercase characters. -A user name cannot contain the following characters: - -" / \ \[ \] : ; | = , + * ? -\< \> @ - -A user name cannot consist only of periods (.) or spaces. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -NoPassword -Indicates that the user account does not have a password. - -```yaml -Type: SwitchParameter -Parameter Sets: NoPassword -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Password -Specifies a password for the user account. -You can use `Read-Host -GetCredential`, Get-Credential, or ConvertTo-SecureString to create a **SecureString** object for the password. - -If you omit the *Password* and *NoPassword* parameters, **New-LocalUser** prompts you for the new user's password. - -```yaml -Type: SecureString -Parameter Sets: Password -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -PasswordNeverExpires -Indicates whether the password expires. - -```yaml -Type: SwitchParameter -Parameter Sets: Password -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -UserMayNotChangePassword -Indicates that the user cannot change the password on the user account. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.String, System.DateTime, System.Boolean, System.Security.SecureString -You can pipe a string, a **DateTime** object, a **Boolean** value, or a secure string to this cmdlet. - -## OUTPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser -This cmdlet returns a **LocalUser** object. -This object provides information about the user account. - -## NOTES -* A user name cannot be identical to any other user name or group name on the computer. A user name cannot consist only of periods (.) or spaces. A user name can contain up to 20 uppercase characters or lowercase characters. A user name cannot contain the following characters: - -" / \ \[ \] : ; | = , + * ? \< \> @ -* A password can contain up to 127 characters. -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroup.md deleted file mode 100644 index afd958333f2e..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroup.md +++ /dev/null @@ -1,181 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822517 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Remove-LocalGroup ---- - -# Remove-LocalGroup - -## SYNOPSIS -Deletes local security groups. - -## SYNTAX - -### InputObject -``` -Remove-LocalGroup [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Remove-LocalGroup [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Remove-LocalGroup [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Remove-LocalGroup** cmdlet deletes local security groups. -This cmdlet deletes only a local group. -It does not delete the user accounts, computer accounts, or group accounts that belong to that group. -You cannot recover a deleted group. - -If you delete a group and then create another group that has the same group name, you must set new permissions for the new group. -The new group does not inherit the permissions that were assigned to the group. - -## EXAMPLES - -### Example 1: Delete a security group -``` -PS C:\> Remove-LocalGroup -Name "SecurityGroup04" -``` - -This command deletes the group named SecurityGroup04. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies an array of security groups that this cmdlet deletes. -To obtain groups, use the Get-LocalGroup cmdlet. - -```yaml -Type: LocalGroup[] -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies an array of names of the security groups that this cmdlet deletes. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of security IDs (SIDs) of security groups that this cmdlet deletes. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a security group, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* This cmdlet cannot delete the following default groups: - -- Administrators -- Backup Operators -- Cryptographic Operators -- Distributed COM Users -- Event Log Readers -- Guests -- Hyper-V Administrators -- IIS_IUSRS -- Network Configuration Operators -- Performance Log Users -- Performance Monitor Users -- Power Users -- Remote Desktop Users -- Remote Management Users -- Replicator -- Users -- WinRMRemoteWMIUsers__ -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroup](Get-LocalGroup.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Rename-LocalGroup](Rename-LocalGroup.md) - -[Set-LocalGroup](Set-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroupMember.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroupMember.md deleted file mode 100644 index b14a7ae141db..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalGroupMember.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822518 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Remove-LocalGroupMember ---- - -# Remove-LocalGroupMember - -## SYNOPSIS -Removes members from a local group. - -## SYNTAX - -### Group -``` -Remove-LocalGroupMember [-Group] [-Member] [-WhatIf] [-Confirm] - [] -``` - -### Default -``` -Remove-LocalGroupMember [-Member] [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Remove-LocalGroupMember [-Member] [-SID] [-WhatIf] [-Confirm] - [] -``` - -## DESCRIPTION -The **Remove-LocalGroupMember** cmdlet removes users or groups from a local group. - -## EXAMPLES - -### Example 1: Remove members from the Administrators group -``` -PS C:\> Remove-LocalGroupMember -Group "Administrators" -Member "Admin02", "MicrosoftAccount\username@Outlook.com", "AzureAD\DavidChew@contoso.com", "CONTOSO\Domain Admins" -``` - -This command removes several members from the local Administrators group. -The members that this cmdlet removes include a local user account, a Microsoft account, an Azure Active Directory account, and a domain group. -This example uses a placeholder value for the user name of an account at Outlook.com. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Group -Specifies the security group from which this cmdlet removes members. - -```yaml -Type: LocalGroup -Parameter Sets: Group -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Member -Specifies an array of users or groups that this cmdlet removes from a security group. -You can specify users or groups by name, security ID (SID), or **LocalPrincipal** objects. -Specify SID strings in S-R-I-S-S . -. . -format. - -```yaml -Type: LocalPrincipal[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group from which this cmdlet removes members. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID of the security group from which this cmdlet removes members. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalPrincipal, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local principal, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Add-LocalGroupMember](Add-LocalGroupMember.md) - -[Get-LocalGroupMember](Get-LocalGroupMember.md) - -[New-LocalGroup](New-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalUser.md deleted file mode 100644 index 7ef7bbc5fccb..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Remove-LocalUser.md +++ /dev/null @@ -1,160 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822519 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Remove-LocalUser ---- - -# Remove-LocalUser - -## SYNOPSIS -Deletes local user accounts. - -## SYNTAX - -### InputObject -``` -Remove-LocalUser [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Remove-LocalUser [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Remove-LocalUser [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Remove-LocalUser** cmdlet deletes local user accounts. - -## EXAMPLES - -### Example 1: Delete a user account -``` -PS C:\> Remove-LocalUser -Name "AdminContoso02" -``` - -This command deletes the user account named AdminContoso02. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies an array of user accounts that this cmdlet deletes. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser[] -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies an array of names of the user accounts that this cmdlet deletes. - -```yaml -Type: String[] -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies an array of security IDs (SIDs) of user accounts that this cmdlet deletes. - -```yaml -Type: SecurityIdentifier[] -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalGroup.md deleted file mode 100644 index 0d88c9795788..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalGroup.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822520 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Rename-LocalGroup ---- - -# Rename-LocalGroup - -## SYNOPSIS -Renames a local security group. - -## SYNTAX - -### InputObject -``` -Rename-LocalGroup [-InputObject] [-NewName] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Rename-LocalGroup [-Name] [-NewName] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Rename-LocalGroup [-NewName] [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Rename-LocalGroup** cmdlet renames a local security group. - -## EXAMPLES - -### Example 1: Change the name of a group -``` -PS C:\> Rename-LocalGroup -Name "SecurityGroup" -NewName "SecurityGroup04" -``` - -This command renames a security group named SecurityGroup. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies the security group that this cmdlet renames. -To obtain a security group, use the Get-LocalGroup cmdlet. - -```yaml -Type: LocalGroup -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group that this cmdlet renames. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -NewName -Specifies a new name for the security group. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID (SID) of a security group that this cmdlet renames. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a security group, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroup](Get-LocalGroup.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroup](Remove-LocalGroup.md) - -[Set-LocalGroup](Set-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalUser.md deleted file mode 100644 index fced244875f7..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Rename-LocalUser.md +++ /dev/null @@ -1,175 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822521 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Rename-LocalUser ---- - -# Rename-LocalUser - -## SYNOPSIS -Renames a local user account. - -## SYNTAX - -### InputObject -``` -Rename-LocalUser [-InputObject] [-NewName] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Rename-LocalUser [-Name] [-NewName] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Rename-LocalUser [-NewName] [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Rename-LocalUser** cmdlet renames a local user account. - -## EXAMPLES - -### Example 1: Rename a user account -``` -PS C:\> Rename-LocalUser -Name "Admin02" -NewName "AdminContoso02" -``` - -This command renames the user account named Admin02. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies the user account that this cmdlet renames. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the user account that this cmdlet renames. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -NewName -Specifies a new name for the user account. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID (SID) of a user accounts that this cmdlet renames. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Set-LocalUser](Set-LocalUser.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalGroup.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalGroup.md deleted file mode 100644 index 238d5bd6a331..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalGroup.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822522 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Set-LocalGroup ---- - -# Set-LocalGroup - -## SYNOPSIS -Changes a local security group. - -## SYNTAX - -### InputObject -``` -Set-LocalGroup -Description [-InputObject] [-WhatIf] [-Confirm] [] -``` - -### Default -``` -Set-LocalGroup -Description [-Name] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Set-LocalGroup -Description [-SID] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Set-LocalGroup** cmdlet changes a local security group. - -## EXAMPLES - -### Example 1: Change a group description -``` -PS C:\> Set-LocalGroup -Name "SecurityGroup04" -Description "This is a sample description." -``` - -This command changes the description of a local group. - -## PARAMETERS - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Description -Specifies a comment for the group. -The maximum length is 48 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies the security group that this cmdlet changes. -To obtain a security group, use the Get-LocalGroup cmdlet. - -```yaml -Type: LocalGroup -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the security group that this cmdlet changes. - -```yaml -Type: String -Parameter Sets: Default -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID (SID) of the security group that this cmdlet changes. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalGroup, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a security group, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Get-LocalGroup](Get-LocalGroup.md) - -[New-LocalGroup](New-LocalGroup.md) - -[Remove-LocalGroup](Remove-LocalGroup.md) - -[Rename-LocalGroup](Rename-LocalGroup.md) - diff --git a/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalUser.md b/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalUser.md deleted file mode 100644 index f04f6453896c..000000000000 --- a/reference/6/Microsoft.PowerShell.LocalAccounts/Set-LocalUser.md +++ /dev/null @@ -1,297 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -online version: http://go.microsoft.com/fwlink/?LinkId=822523 -external help file: Microsoft.Powershell.LocalAccounts.dll-Help.xml -title: Set-LocalUser ---- - -# Set-LocalUser - -## SYNOPSIS -Modifies a local user account. - -## SYNTAX - -### Name (Default) -``` -Set-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-FullName ] - [-Name] [-Password ] [-PasswordNeverExpires ] - [-UserMayChangePassword ] [-WhatIf] [-Confirm] [] -``` - -### InputObject -``` -Set-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-FullName ] - [-InputObject] [-Password ] [-PasswordNeverExpires ] - [-UserMayChangePassword ] [-WhatIf] [-Confirm] [] -``` - -### SecurityIdentifier -``` -Set-LocalUser [-AccountExpires ] [-AccountNeverExpires] [-Description ] [-FullName ] - [-Password ] [-PasswordNeverExpires ] [-SID] - [-UserMayChangePassword ] [-WhatIf] [-Confirm] [] -``` - -## DESCRIPTION -The **Set-LocalUser** cmdlet modifies a local user account. -This cmdlet can reset the password of a local user account. - -## EXAMPLES - -### Example 1: Change a description of a user account -``` -PS C:\> Set-LocalUser -Name "Admin07" -Description "Description of this account." -``` - -This command changes the description of a user account named Admin07. - -### Example 2: Change the password on an account -``` -PS C:\> $Password = Read-Host -AsSecureString -PS C:\> $UserAccount = Get-LocalUser -Name "User02" -PS C:\> $UserAccount | Set-LocalUser -Password $Password -``` - -The first command prompts you for a password by using the Read-Host cmdlet. -The command stores the password as a secure string in the $Password variable. - -The second command gets a user account named User02 by using **Get-LocalUser**. -The command stores the account in the $UserAccount variable. - -The third command sets the new password on the user account stored in $UserAccount. - -## PARAMETERS - -### -AccountExpires -Specifies when the user account expires. -To obtain a **DateTime** object, use the Get-Date cmdlet. - -If you do not want the account to expire, specify the *AccountNeverExpires* parameter. - -```yaml -Type: DateTime -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -AccountNeverExpires -Indicates that the account does not expire. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Confirm -Prompts you for confirmation before running the cmdlet. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: cf - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Description -Specifies a comment for the user account. -The maximum length is 48 characters. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -FullName -Specifies the full name for the user account. -The full name differs from the user name of the user account. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -Specifies the user account that this cmdlet changes. -To obtain a user account, use the Get-LocalUser cmdlet. - -```yaml -Type: LocalUser -Parameter Sets: InputObject -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Name -Specifies the name of the user account that this cmdlet changes. - -```yaml -Type: String -Parameter Sets: Name -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -Password -Specifies a password for the user account. -If the user account is connected to a Microsoft account, do not set a password. - -You can use `Read-Host -GetCredential`, Get-Credential, or ConvertTo-SecureString to create a **SecureString** object for the password. - -If you omit the *Password* and *NoPassword* parameters, **Set-LocalUser** prompts you for the user's password. - -```yaml -Type: SecureString -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PasswordNeverExpires -Indicates whether the password expires. - -```yaml -Type: Boolean -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SID -Specifies the security ID (SID) of the user account that this cmdlet changes. - -```yaml -Type: SecurityIdentifier -Parameter Sets: SecurityIdentifier -Aliases: - -Required: True -Position: 0 -Default value: None -Accept pipeline input: True (ByPropertyName, ByValue) -Accept wildcard characters: False -``` - -### -UserMayChangePassword -Indicates that the user can change the password on the user account. - -```yaml -Type: Boolean -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -WhatIf -Shows what would happen if the cmdlet runs. -The cmdlet is not run. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: wi - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### CommonParameters -This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). - -## INPUTS - -### System.Management.Automation.SecurityAccountsManager.LocalUser, System.String, System.Security.Principal.SecurityIdentifier -You can pipe a local user, a string, or a SID to this cmdlet. - -## OUTPUTS - -### None -This cmdlet does not generate any output. - -## NOTES -* The **PrincipalSource** property is a property on **LocalUser**, **LocalGroup**, and **LocalPrincipal** objects that describes the source of the object. The possible sources are as follows: - -- Local -- Active Directory -- Azure Active Directory group -- Microsoft Account - -**PrincipalSource** is supported only by Windows 10, Windows Server 2016, and later versions of the Windows operating system. For earlier versions, the property is blank. - -## RELATED LINKS - -[Disable-LocalUser](Disable-LocalUser.md) - -[Enable-LocalUser](Enable-LocalUser.md) - -[Get-LocalUser](Get-LocalUser.md) - -[New-LocalUser](New-LocalUser.md) - -[Remove-LocalUser](Remove-LocalUser.md) - -[Rename-LocalUser](Rename-LocalUser.md) - diff --git a/reference/6/Pester/AfterAll.md b/reference/6/Pester/AfterAll.md deleted file mode 100644 index 01b5b6e83bac..000000000000 --- a/reference/6/Pester/AfterAll.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# AfterAll - -## SYNOPSIS -Defines a series of steps to perform at the end of every It block within -the current Context or Describe block. - -## SYNTAX - -``` -AfterAll -``` - -## DESCRIPTION -BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply -to the entire Context or Describe block, regardless of the order of the -statements in the Context or Describe. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_BeforeEach_AfterEach]() - diff --git a/reference/6/Pester/AfterEach.md b/reference/6/Pester/AfterEach.md deleted file mode 100644 index 8ba9f6673413..000000000000 --- a/reference/6/Pester/AfterEach.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# AfterEach - -## SYNOPSIS -Defines a series of steps to perform at the end of every It block within -the current Context or Describe block. - -## SYNTAX - -``` -AfterEach -``` - -## DESCRIPTION -BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply -to the entire Context or Describe block, regardless of the order of the -statements in the Context or Describe. -For a full description of this -behavior, as well as how multiple BeforeEach or AfterEach blocks interact -with each other, please refer to the about_BeforeEach_AfterEach help file. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_BeforeEach_AfterEach]() - diff --git a/reference/6/Pester/Assert-MockCalled.md b/reference/6/Pester/Assert-MockCalled.md deleted file mode 100644 index f59cd0ef26dc..000000000000 --- a/reference/6/Pester/Assert-MockCalled.md +++ /dev/null @@ -1,272 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Assert-MockCalled - -## SYNOPSIS -Checks if a Mocked command has been called a certain number of times -and throws an exception if it has not. - -## SYNTAX - -### ParameterFilter (Default) -``` -Assert-MockCalled [-CommandName] [[-Times] ] [[-ParameterFilter] ] - [[-ModuleName] ] [[-Scope] ] [-Exactly] -``` - -### ExclusiveFilter -``` -Assert-MockCalled [-CommandName] [[-Times] ] -ExclusiveFilter - [[-ModuleName] ] [[-Scope] ] [-Exactly] -``` - -## DESCRIPTION -This command verifies that a mocked command has been called a certain number -of times. -If the call history of the mocked command does not match the parameters -passed to Assert-MockCalled, Assert-MockCalled will throw an exception. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Mock Set-Content {} -``` - -{... -Some Code ...} - -C:\PS\>Assert-MockCalled Set-Content - -This will throw an exception and cause the test to fail if Set-Content is not called in Some Code. - -### -------------------------- EXAMPLE 2 -------------------------- -``` -Mock Set-Content -parameterFilter {$path.StartsWith("$env:temp\")} -``` - -{... -Some Code ...} - -C:\PS\>Assert-MockCalled Set-Content 2 { $path -eq "$env:temp\test.txt" } - -This will throw an exception if some code calls Set-Content on $path=$env:temp\test.txt less than 2 times - -### -------------------------- EXAMPLE 3 -------------------------- -``` -Mock Set-Content {} -``` - -{... -Some Code ...} - -C:\PS\>Assert-MockCalled Set-Content 0 - -This will throw an exception if some code calls Set-Content at all - -### -------------------------- EXAMPLE 4 -------------------------- -``` -Mock Set-Content {} -``` - -{... -Some Code ...} - -C:\PS\>Assert-MockCalled Set-Content -Exactly 2 - -This will throw an exception if some code does not call Set-Content Exactly two times. - -### -------------------------- EXAMPLE 5 -------------------------- -``` -Describe 'Assert-MockCalled Scope behavior' { -``` - -Mock Set-Content { } - - It 'Calls Set-Content at least once in the It block' { - {... -Some Code ...} - - Assert-MockCalled Set-Content -Exactly 0 -Scope It - } -} - -Checks for calls only within the current It block. - -### -------------------------- EXAMPLE 6 -------------------------- -``` -Describe 'Describe' { -``` - -Mock -ModuleName SomeModule Set-Content { } - - {... -Some Code ...} - - It 'Calls Set-Content at least once in the Describe block' { - Assert-MockCalled -ModuleName SomeModule Set-Content - } -} - -Checks for calls to the mock within the SomeModule module. -Note that both the Mock -and Assert-MockCalled commands use the same module name. - -### -------------------------- EXAMPLE 7 -------------------------- -``` -Assert-MockCalled Get-ChildItem -ExclusiveFilter { $Path -eq 'C:\' } -``` - -Checks to make sure that Get-ChildItem was called at least one time with -the -Path parameter set to 'C:\', and that it was not called at all with -the -Path parameter set to any other value. - -## PARAMETERS - -### -CommandName -The mocked command whose call history should be checked. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Times -The number of times that the mock must be called to avoid an exception -from throwing. - -```yaml -Type: Int32 -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: 1 -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ParameterFilter -An optional filter to qualify wich calls should be counted. -Only those -calls to the mock whose parameters cause this filter to return true -will be counted. - -```yaml -Type: ScriptBlock -Parameter Sets: ParameterFilter -Aliases: - -Required: False -Position: 3 -Default value: {$True} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ExclusiveFilter -{{Fill ExclusiveFilter Description}} - -```yaml -Type: ScriptBlock -Parameter Sets: ExclusiveFilter -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -The module where the mock being checked was injected. -This is optional, -and must match the ModuleName that was used when setting up the Mock. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Scope -An optional parameter specifying the Pester scope in which to check for -calls to the mocked command. -By default, Assert-MockCalled will find -all calls to the mocked command in the current Context block (if present), -or the current Describe block (if there is no active Context.) Valid -values are Describe, Context and It. -If you use a scope of Describe or -Context, the command will identify all calls to the mocked command in the -current Describe / Context block, as well as all child scopes of that block. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Exactly -If this switch is present, the number specified in Times must match -exactly the number of times the mock has been called. -Otherwise it -must match "at least" the number of times specified. -If the value -passed to the Times parameter is zero, the Exactly switch is implied. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES -The parameter filter passed to Assert-MockCalled does not necessarily have to match the parameter filter -(if any) which was used to create the Mock. -Assert-MockCalled will find any entry in the command history -which matches its parameter filter, regardless of how the Mock was created. -However, if any calls to the -mocked command are made which did not match any mock's parameter filter (resulting in the original command -being executed instead of a mock), these calls to the original command are not tracked in the call history. -In other words, Assert-MockCalled can only be used to check for calls to the mocked implementation, not -to the original. - -## RELATED LINKS - diff --git a/reference/6/Pester/Assert-VerifiableMocks.md b/reference/6/Pester/Assert-VerifiableMocks.md deleted file mode 100644 index a3de168d7cda..000000000000 --- a/reference/6/Pester/Assert-VerifiableMocks.md +++ /dev/null @@ -1,66 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Assert-VerifiableMocks - -## SYNOPSIS -Checks if any Verifiable Mock has not been invoked. -If so, this will throw an exception. - -## SYNTAX - -``` -Assert-VerifiableMocks -``` - -## DESCRIPTION -This can be used in tandem with the -Verifiable switch of the Mock -function. -Mock can be used to mock the behavior of an existing command -and optionally take a -Verifiable switch. -When Assert-VerifiableMocks -is called, it checks to see if any Mock marked Verifiable has not been -invoked. -If any mocks have been found that specified -Verifiable and -have not been invoked, an exception will be thrown. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Mock Set-Content {} -Verifiable -ParameterFilter {$Path -eq "some_path" -and $Value -eq "Expected Value"} -``` - -{ ...some code that never calls Set-Content some_path -Value "Expected Value"... -} - -Assert-VerifiableMocks - -This will throw an exception and cause the test to fail. - -### -------------------------- EXAMPLE 2 -------------------------- -``` -Mock Set-Content {} -Verifiable -ParameterFilter {$Path -eq "some_path" -and $Value -eq "Expected Value"} -``` - -Set-Content some_path -Value "Expected Value" - -Assert-VerifiableMocks - -This will not throw an exception because the mock was invoked. - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/BeforeAll.md b/reference/6/Pester/BeforeAll.md deleted file mode 100644 index da60bd35ef36..000000000000 --- a/reference/6/Pester/BeforeAll.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# BeforeAll - -## SYNOPSIS -Defines a series of steps to perform at the beginning of the current Context -or Describe block. - -## SYNTAX - -``` -BeforeAll -``` - -## DESCRIPTION -BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply -to the entire Context or Describe block, regardless of the order of the -statements in the Context or Describe. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_BeforeEach_AfterEach]() - diff --git a/reference/6/Pester/BeforeEach.md b/reference/6/Pester/BeforeEach.md deleted file mode 100644 index aba5f9c4e3a7..000000000000 --- a/reference/6/Pester/BeforeEach.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# BeforeEach - -## SYNOPSIS -Defines a series of steps to perform at the beginning of every It block within -the current Context or Describe block. - -## SYNTAX - -``` -BeforeEach -``` - -## DESCRIPTION -BeforeEach, AfterEach, BeforeAll, and AfterAll are unique in that they apply -to the entire Context or Describe block, regardless of the order of the -statements in the Context or Describe. -For a full description of this -behavior, as well as how multiple BeforeEach or AfterEach blocks interact -with each other, please refer to the about_BeforeEach_AfterEach help file. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_BeforeEach_AfterEach]() - diff --git a/reference/6/Pester/Context.md b/reference/6/Pester/Context.md deleted file mode 100644 index f38e433771c6..000000000000 --- a/reference/6/Pester/Context.md +++ /dev/null @@ -1,110 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Context - -## SYNOPSIS -Provides logical grouping of It blocks within a single Describe block. -Any Mocks defined -inside a Context are removed at the end of the Context scope, as are any files or folders -added to the TestDrive during the Context block's execution. -Any BeforeEach or AfterEach -blocks defined inside a Context also only apply to tests within that Context . - -## SYNTAX - -``` -Context [-Name] [[-Fixture] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -function Add-Numbers($a, $b) { -``` - -return $a + $b -} - -Describe "Add-Numbers" { - - Context "when root does not exist" { - It "..." { ... -} - } - - Context "when root does exist" { - It "..." { ... -} - It "..." { ... -} - It "..." { ... -} - } -} - -## PARAMETERS - -### -Name -The name of the Context. -This is a phrase describing a set of tests within a describe. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Fixture -Script that is executed. -This may include setup specific to the context and one or more It -blocks that validate the expected outcomes. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Describe](Describe.md) - -[It](It.md) - -[BeforeEach](BeforeEach.md) - -[AfterEach](AfterEach.md) - -[about_Should]() - -[about_Mocking]() - -[about_TestDrive]() \ No newline at end of file diff --git a/reference/6/Pester/Describe.md b/reference/6/Pester/Describe.md deleted file mode 100644 index 977c50108716..000000000000 --- a/reference/6/Pester/Describe.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Describe - -## SYNOPSIS -Creates a logical group of tests. -All Mocks and TestDrive contents -defined within a Describe block are scoped to that Describe; they -will no longer be present when the Describe block exits. -A Describe -block may contain any number of Context and It blocks. - -## SYNTAX - -``` -Describe [-Name] [-Tags ] [[-Fixture] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -function Add-Numbers($a, $b) { -``` - -return $a + $b -} - -Describe "Add-Numbers" { - It "adds positive numbers" { - $sum = Add-Numbers 2 3 - $sum | Should Be 5 - } - - It "adds negative numbers" { - $sum = Add-Numbers (-2) (-2) - $sum | Should Be (-4) - } - - It "adds one negative number to positive number" { - $sum = Add-Numbers (-2) 2 - $sum | Should Be 0 - } - - It "concatenates strings if given strings" { - $sum = Add-Numbers two three - $sum | Should Be "twothree" - } -} - -## PARAMETERS - -### -Name -The name of the test group. -This is often an expressive phrase describing the scenario being tested. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Tags -Optional parameter containing an array of strings. -When calling Invoke-Pester, it is possible to -specify a -Tag parameter which will only execute Describe blocks containing the same Tag. - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: @() -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Fixture -The actual test script. -If you are following the AAA pattern (Arrange-Act-Assert), this -typically holds the arrange and act sections. -The Asserts will also lie in this block but are -typically nested each in its own It block. -Assertions are typically performed by the Should -command within the It blocks. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[It](It.md) - -[Context](Context.md) - -[Invoke-Pester](Invoke-Pester.md) - -[about_Should]() - -[about_Mocking]() - -[about_TestDrive]() diff --git a/reference/6/Pester/Get-MockDynamicParameters.md b/reference/6/Pester/Get-MockDynamicParameters.md deleted file mode 100644 index 1940d0fffa79..000000000000 --- a/reference/6/Pester/Get-MockDynamicParameters.md +++ /dev/null @@ -1,124 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Get-MockDynamicParameters - -## SYNOPSIS -This command is used by Pester's Mocking framework. -You do not need to call it directly. - -## SYNTAX - -### Cmdlet -``` -Get-MockDynamicParameters -CmdletName [-Parameters ] [-Cmdlet ] -``` - -### Function -``` -Get-MockDynamicParameters -FunctionName [-ModuleName ] [-Parameters ] - [-Cmdlet ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -CmdletName -{{Fill CmdletName Description}} - -```yaml -Type: String -Parameter Sets: Cmdlet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -FunctionName -{{Fill FunctionName Description}} - -```yaml -Type: String -Parameter Sets: Function -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -{{Fill ModuleName Description}} - -```yaml -Type: String -Parameter Sets: Function -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Parameters -{{Fill Parameters Description}} - -```yaml -Type: Hashtable -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Cmdlet -{{Fill Cmdlet Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Get-TestDriveItem.md b/reference/6/Pester/Get-TestDriveItem.md deleted file mode 100644 index 8efd4be3c273..000000000000 --- a/reference/6/Pester/Get-TestDriveItem.md +++ /dev/null @@ -1,61 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Get-TestDriveItem - -## SYNOPSIS -{{Fill in the Synopsis}} - -## SYNTAX - -``` -Get-TestDriveItem [[-Path] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -Path -{{Fill Path Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -### None - - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/In.md b/reference/6/Pester/In.md deleted file mode 100644 index 4df24be3c78d..000000000000 --- a/reference/6/Pester/In.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# In - -## SYNOPSIS -A convenience function that executes a script from a specified path. - -## SYNTAX - -``` -In [[-path] ] [[-execute] ] -``` - -## DESCRIPTION -Before the script block passed to the execute parameter is invoked, -the current location is set to the path specified. -Once the script -block has been executed, the location will be reset to the location -the script was in prior to calling In. - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -path -The path that the execute block will be executed in. - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -execute -The script to be executed in the path provided. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/InModuleScope.md b/reference/6/Pester/InModuleScope.md deleted file mode 100644 index d30844361fc8..000000000000 --- a/reference/6/Pester/InModuleScope.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# InModuleScope - -## SYNOPSIS -Allows you to execute parts of a test script within the -scope of a PowerShell script module. - -## SYNTAX - -``` -InModuleScope [-ModuleName] [-ScriptBlock] -``` - -## DESCRIPTION -By injecting some test code into the scope of a PowerShell -script module, you can use non-exported functions, aliases -and variables inside that module, to perform unit tests on -its internal implementation. - -InModuleScope may be used anywhere inside a Pester script, -either inside or outside a Describe block. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -# The script module: -``` - -function PublicFunction -{ - # Does something -} - -function PrivateFunction -{ - return $true -} - -Export-ModuleMember -Function PublicFunction - -The test script: - -Import-Module MyModule - -InModuleScope MyModule { - Describe 'Testing MyModule' { - It 'Tests the Private function' { - PrivateFunction | Should Be $true - } - } -} - -Normally you would not be able to access "PrivateFunction" from -the powershell session, because the module only exported -"PublicFunction". -Using InModuleScope allowed this call to -"PrivateFunction" to work successfully. - -## PARAMETERS - -### -ModuleName -The name of the module into which the test code should be -injected. -This module must already be loaded into the current -PowerShell session. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ScriptBlock -The code to be executed within the script module. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Invoke-Mock.md b/reference/6/Pester/Invoke-Mock.md deleted file mode 100644 index 733d4d2ada47..000000000000 --- a/reference/6/Pester/Invoke-Mock.md +++ /dev/null @@ -1,164 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Invoke-Mock - -## SYNOPSIS -This command is used by Pester's Mocking framework. -You do not need to call it directly. - -## SYNTAX - -``` -Invoke-Mock [-CommandName] [-MockCallState] [[-ModuleName] ] - [[-BoundParameters] ] [[-ArgumentList] ] [[-CallerSessionState] ] - [[-FromBlock] ] [[-InputObject] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -CommandName -{{Fill CommandName Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -MockCallState -{{Fill MockCallState Description}} - -```yaml -Type: Hashtable -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -{{Fill ModuleName Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -BoundParameters -{{Fill BoundParameters Description}} - -```yaml -Type: Hashtable -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: @{} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ArgumentList -{{Fill ArgumentList Description}} - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: 5 -Default value: @() -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -CallerSessionState -{{Fill CallerSessionState Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 6 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -FromBlock -{{Fill FromBlock Description}} - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 7 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -InputObject -{{Fill InputObject Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 8 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Invoke-Pester.md b/reference/6/Pester/Invoke-Pester.md deleted file mode 100644 index d0d84146ea1b..000000000000 --- a/reference/6/Pester/Invoke-Pester.md +++ /dev/null @@ -1,353 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Invoke-Pester - -## SYNOPSIS -Invokes Pester to run all tests (files containing *.Tests.ps1) recursively under the Path - -## SYNTAX - -### LegacyOutputXml (Default) -``` -Invoke-Pester [[-Script] ] [[-TestName] ] [-EnableExit] [[-OutputXml] ] - [[-Tag] ] [-ExcludeTag ] [-PassThru] [-CodeCoverage ] [-Strict] [-Quiet] - [-PesterOption ] -``` - -### NewOutputSet -``` -Invoke-Pester [[-Script] ] [[-TestName] ] [-EnableExit] [[-Tag] ] - [-ExcludeTag ] [-PassThru] [-CodeCoverage ] [-Strict] -OutputFile - -OutputFormat [-Quiet] [-PesterOption ] -``` - -## DESCRIPTION -Upon calling Invoke-Pester, all files that have a name containing -"*.Tests.ps1" will have the tests defined in their Describe blocks -executed. -Invoke-Pester begins at the location of Path and -runs recursively through each sub directory looking for -"*.Tests.ps1" files containing tests. -If a TestName is provided, -Invoke-Pester will only run tests that have a describe block with a -matching name. -By default, Invoke-Pester will end the test run with a -simple report of the number of tests passed and failed output to the -console. -One may want pester to "fail a build" in the event that any -tests fail. -To accomodate this, Invoke-Pester will return an exit -code equal to the number of failed tests if the EnableExit switch is -set. -Invoke-Pester will also write a NUnit style log of test results -if the OutputXml parameter is provided. -In these cases, Invoke-Pester -will write the result log to the path provided in the OutputXml -parameter. - -Optionally, Pester can generate a report of how much code is covered -by the tests, and information about any commands which were not -executed. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Invoke-Pester -``` - -This will find all *.Tests.ps1 files and run their tests. -No exit code will be returned and no log file will be saved. - -### -------------------------- EXAMPLE 2 -------------------------- -``` -Invoke-Pester -Script ./tests/Utils* -``` - -This will run all tests in files under ./Tests that begin with Utils and alsocontains .Tests. - -### -------------------------- EXAMPLE 3 -------------------------- -``` -Invoke-Pester -Script @{ Path = './tests/Utils*'; Parameters = @{ NamedParameter = 'Passed By Name' }; Arguments = @('Passed by position') } -``` - -Executes the same tests as in Example 1, but will run them with the equivalent of the following command line: & $testScriptPath -NamedParameter 'Passed By Name' 'Passed by position' - -### -------------------------- EXAMPLE 4 -------------------------- -``` -Invoke-Pester -TestName "Add Numbers" -``` - -This will only run the Describe block named "Add Numbers" - -### -------------------------- EXAMPLE 5 -------------------------- -``` -Invoke-Pester -EnableExit -OutputXml "./artifacts/TestResults.xml" -``` - -This runs all tests from the current directory downwards and writes the results according to the NUnit schema to artifacts/TestResults.xml just below the current directory. -The test run will return an exit code equal to the number of test failures. - -### -------------------------- EXAMPLE 6 -------------------------- -``` -Invoke-Pester -EnableExit -OutputFile "./artifacts/TestResults.xml" -OutputFormat NUnitxml -``` - -This runs all tests from the current directory downwards and writes the results to an output file and NUnitxml output format - -### -------------------------- EXAMPLE 7 -------------------------- -``` -Invoke-Pester -CodeCoverage 'ScriptUnderTest.ps1' -``` - -Runs all *.Tests.ps1 scripts in the current directory, and generates a coverage report for all commands in the "ScriptUnderTest.ps1" file. - -### -------------------------- EXAMPLE 8 -------------------------- -``` -Invoke-Pester -CodeCoverage @{ Path = 'ScriptUnderTest.ps1'; Function = 'FunctionUnderTest' } -``` - -Runs all *.Tests.ps1 scripts in the current directory, and generates a coverage report for all commands in the "FunctionUnderTest" function in the "ScriptUnderTest.ps1" file. - -### -------------------------- EXAMPLE 9 -------------------------- -``` -Invoke-Pester -CodeCoverage @{ Path = 'ScriptUnderTest.ps1'; StartLine = 10; EndLine = 20 } -``` - -Runs all *.Tests.ps1 scripts in the current directory, and generates a coverage report for all commands on lines 10 through 20 in the "ScriptUnderTest.ps1" file. - -## PARAMETERS - -### -Script -This parameter indicates which test scripts should be run. -This parameter may be passed simple strings (wildcards are allowed), or hashtables containing Path, Arguments and Parameters keys. -If hashtables are used, the Parameters key must refer to a hashtable, and the Arguments key must refer to an array; these will be splatted to the test script(s) indicated in the Path key. - -Note: If the path contains any wildcards, or if it refers to a directory, then Pester will search for and execute all test scripts named *.Tests.ps1 in the target path; the search is recursive. -If the path contains no wildcards and refers to a file, Pester will just try to execute that file regardless of its name. - -Aliased to 'Path' and 'relative_path' for backwards compatibility. - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: Path, relative_path - -Required: False -Position: 1 -Default value: . -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -TestName -Informs Invoke-Pester to only run Describe blocks that match this name. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: Name - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -EnableExit -Will cause Invoke-Pester to exit with a exit code equal to the number of failed tests once all tests have been run. -Use this to "fail" a build when any tests fail. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -OutputXml -The path where Invoke-Pester will save a NUnit formatted test results log file. -If this path is not provided, no log will be generated. - -```yaml -Type: String -Parameter Sets: LegacyOutputXml -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Tag -Informs Invoke-Pester to only run Describe blocks tagged with the tags specified. -Aliased 'Tags' for backwards compatibility. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: Tags - -Required: False -Position: 5 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ExcludeTag -Informs Invoke-Pester to not run blocks tagged with the tags specified. - -```yaml -Type: String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -Returns a Pester result object containing the information about the whole test run, and each test. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -CodeCoverage -Instructs Pester to generate a code coverage report in addition to running tests. -You may pass either hashtables or strings to this parameter. -If strings are used, they must be paths (wildcards allowed) to source files, and all commands in the files are analyzed for code coverage. -By passing hashtables instead, you can limit the analysis to specific lines or functions within a file. -Hashtables must contain a Path key (which can be abbreviated to just "P"), and may contain Function (or "F"), StartLine (or "S"), and EndLine ("E") keys to narrow down the commands to be analyzed. -If Function is specified, StartLine and EndLine are ignored. -If only StartLine is defined, the entire script file starting with StartLine is analyzed. -If only EndLine is present, all lines in the script file up to and including EndLine are analyzed. -Both Function and Path (as well as simple strings passed instead of hashtables) may contain wildcards. - -```yaml -Type: Object[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: @() -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Strict -Makes Pending and Skipped tests to Failed tests. -Useful for continuous integration where you need to make sure all tests passed. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -OutputFile -{{Fill OutputFile Description}} - -```yaml -Type: String -Parameter Sets: NewOutputSet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -OutputFormat -{{Fill OutputFormat Description}} - -```yaml -Type: String -Parameter Sets: NewOutputSet -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Quiet -Disables the output Pester writes to screen. -No other output is generated unless you specify PassThru, or one of the Output parameters. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PesterOption -Sets advanced options for the test execution. -Enter a PesterOption object, such as one that you create by using the New-PesterOption cmdlet, or a hash table in which the keys are option names and the values are option values. -For more information on the options available, see the help for New-PesterOption. - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Describe](describe.md) - diff --git a/reference/6/Pester/It.md b/reference/6/Pester/It.md deleted file mode 100644 index 23d8439bee6b..000000000000 --- a/reference/6/Pester/It.md +++ /dev/null @@ -1,209 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# It - -## SYNOPSIS -Validates the results of a test inside of a Describe block. - -## SYNTAX - -### Normal (Default) -``` -It [-name] [[-test] ] [-TestCases ] -``` - -### Pending -``` -It [-name] [[-test] ] [-TestCases ] [-Pending] -``` - -### Skip -``` -It [-name] [[-test] ] [-TestCases ] [-Skip] -``` - -## DESCRIPTION -The It command is intended to be used inside of a Describe or Context Block. -If you are familiar with the AAA pattern (Arrange-Act-Assert), the body of -the It block is the appropriate location for an assert. -The convention is to -assert a single expectation for each It block. -The code inside of the It block -should throw a terminating error if the expectation of the test is not met and -thus cause the test to fail. -The name of the It block should expressively state -the expectation of the test. - -In addition to using your own logic to test expectations and throw exceptions, -you may also use Pester's Should command to perform assertions in plain language. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -function Add-Numbers($a, $b) { -``` - -return $a + $b -} - -Describe "Add-Numbers" { - It "adds positive numbers" { - $sum = Add-Numbers 2 3 - $sum | Should Be 5 - } - - It "adds negative numbers" { - $sum = Add-Numbers (-2) (-2) - $sum | Should Be (-4) - } - - It "adds one negative number to positive number" { - $sum = Add-Numbers (-2) 2 - $sum | Should Be 0 - } - - It "concatenates strings if given strings" { - $sum = Add-Numbers two three - $sum | Should Be "twothree" - } -} - -### -------------------------- EXAMPLE 2 -------------------------- -``` -function Add-Numbers($a, $b) { -``` - -return $a + $b -} - -Describe "Add-Numbers" { - $testCases = @( - @{ a = 2; b = 3; expectedResult = 5 } - @{ a = -2; b = -2; expectedResult = -4 } - @{ a = -2; b = 2; expectedResult = 0 } - @{ a = 'two'; b = 'three'; expectedResult = 'twothree' } - ) - - It 'Correctly adds \ and \ to get \' -TestCases $testCases { - param ($a, $b, $expectedResult) - - $sum = Add-Numbers $a $b - $sum | Should Be $expectedResult - } -} - -## PARAMETERS - -### -name -An expressive phsae describing the expected test outcome. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -test -The script block that should throw an exception if the -expectation of the test is not met.If you are following the -AAA pattern (Arrange-Act-Assert), this typically holds the -Assert. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: {} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -TestCases -Optional array of hashtable (or any IDictionary) objects. -If this parameter is used, -Pester will call the test script block once for each table in the TestCases array, -splatting the dictionary to the test script block as input. -If you want the name of -the test to appear differently for each test case, you can embed tokens into the Name -parameter with the syntax 'Adds numbers \ and \' (assuming you have keys named A and B -in your TestCases hashtables.) - -```yaml -Type: IDictionary[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Pending -Use this parameter to explicitly mark the test as work-in-progress/not implemented/pending when you -need to distinguish a test that fails because it is not finished yet from a tests -that fail as a result of changes being made in the code base. -An empty test, that is a -test that contains nothing except whitespace or comments is marked as Pending by default. - -```yaml -Type: SwitchParameter -Parameter Sets: Pending -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Skip -Use this parameter to explicitly mark the test to be skipped. -This is preferable to temporarily -commenting out a test, because the test remains listed in the output. -Use the Strict parameter -of Invoke-Pester to force all skipped tests to fail. - -```yaml -Type: SwitchParameter -Parameter Sets: Skip -Aliases: Ignore - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Describe](Describe.md) - -[Context](Context.md) - -[about_Should]() diff --git a/reference/6/Pester/Mock.md b/reference/6/Pester/Mock.md deleted file mode 100644 index 674ec8770136..000000000000 --- a/reference/6/Pester/Mock.md +++ /dev/null @@ -1,287 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Mock - -## SYNOPSIS -Mocks the behavior of an existing command with an alternate -implementation. - -## SYNTAX - -``` -Mock [[-CommandName] ] [[-MockWith] ] [-Verifiable] [[-ParameterFilter] ] - [[-ModuleName] ] -``` - -## DESCRIPTION -This creates new behavior for any existing command within the scope of a -Describe or Context block. -The function allows you to specify a script block -that will become the command's new behavior. - -Optionally, you may create a Parameter Filter which will examine the -parameters passed to the mocked command and will invoke the mocked -behavior only if the values of the parameter values pass the filter. -If -they do not, the original command implementation will be invoked instead -of a mock. - -You may create multiple mocks for the same command, each using a different -ParameterFilter. -ParameterFilters will be evaluated in reverse order of -their creation. -The last one created will be the first to be evaluated. -The mock of the first filter to pass will be used. -The exception to this -rule are Mocks with no filters. -They will always be evaluated last since -they will act as a "catch all" mock. - -Mocks can be marked Verifiable. -If so, the Assert-VerifiableMocks command -can be used to check if all Verifiable mocks were actually called. -If any -verifiable mock is not called, Assert-VerifiableMocks will throw an -exception and indicate all mocks not called. - -If you wish to mock commands that are called from inside a script module, -you can do so by using the -ModuleName parameter to the Mock command. -This -injects the mock into the specified module. -If you do not specify a -module name, the mock will be created in the same scope as the test script. -You may mock the same command multiple times, in different scopes, as needed. -Each module's mock maintains a separate call history and verified status. - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -``` - -Using this Mock, all calls to Get-ChildItem will return a hashtable with a -FullName property returning "A_File.TXT" - -### -------------------------- EXAMPLE 2 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp) } -``` - -This Mock will only be applied to Get-ChildItem calls within the user's temp directory. - -### -------------------------- EXAMPLE 3 -------------------------- -``` -Mock Set-Content {} -Verifiable -ParameterFilter { $Path -eq "some_path" -and $Value -eq "Expected Value" } -``` - -When this mock is used, if the Mock is never invoked and Assert-VerifiableMocks is called, an exception will be thrown. -The command behavior will do nothing since the ScriptBlock is empty. - -### -------------------------- EXAMPLE 4 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp\1) } -``` - -Mock Get-ChildItem { return @{FullName = "B_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp\2) } -Mock Get-ChildItem { return @{FullName = "C_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp\3) } - -Multiple mocks of the same command may be used. -The parameter filter determines which is invoked. -Here, if Get-ChildItem is called on the "2" directory of the temp folder, then B_File.txt will be returned. - -### -------------------------- EXAMPLE 5 -------------------------- -``` -Mock Get-ChildItem { return @{FullName="B_File.TXT"} } -ParameterFilter { $Path -eq "$env:temp\me" } -``` - -Mock Get-ChildItem { return @{FullName="A_File.TXT"} } -ParameterFilter { $Path -and $Path.StartsWith($env:temp) } - -Get-ChildItem $env:temp\me - -Here, both mocks could apply since both filters will pass. -A_File.TXT will be returned because it was the most recent Mock created. - -### -------------------------- EXAMPLE 6 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "B_File.TXT"} } -ParameterFilter { $Path -eq "$env:temp\me" } -``` - -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } - -Get-ChildItem c:\windows - -Here, A_File.TXT will be returned. -Since no filter was specified, it will apply to any call to Get-ChildItem that does not pass another filter. - -### -------------------------- EXAMPLE 7 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "B_File.TXT"} } -ParameterFilter { $Path -eq "$env:temp\me" } -``` - -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } - -Get-ChildItem $env:temp\me - -Here, B_File.TXT will be returned. -Even though the filterless mock was created more recently. -This illustrates that filterless Mocks are always evaluated last regardlss of their creation order. - -### -------------------------- EXAMPLE 8 -------------------------- -``` -Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -ModuleName MyTestModule -``` - -Using this Mock, all calls to Get-ChildItem from within the MyTestModule module -will return a hashtable with a FullName property returning "A_File.TXT" - -### -------------------------- EXAMPLE 9 -------------------------- -``` -Get-Module -Name ModuleMockExample | Remove-Module -``` - -New-Module -Name ModuleMockExample -ScriptBlock { - function Hidden { "Internal Module Function" } - function Exported { Hidden } - - Export-ModuleMember -Function Exported -} | Import-Module -Force - -Describe "ModuleMockExample" { - - It "Hidden function is not directly accessible outside the module" { - { Hidden } | Should Throw - } - - It "Original Hidden function is called" { - Exported | Should Be "Internal Module Function" - } - - It "Hidden is replaced with our implementation" { - Mock Hidden { "Mocked" } -ModuleName ModuleMockExample - Exported | Should Be "Mocked" - } -} - -This example shows how calls to commands made from inside a module can be -mocked by using the -ModuleName parameter. - -## PARAMETERS - -### -CommandName -The name of the command to be mocked. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -MockWith -A ScriptBlock specifying the behvior that will be used to mock CommandName. -The default is an empty ScriptBlock. -NOTE: Do not specify param or dynamicparam blocks in this script block. -These will be injected automatically based on the signature of the command -being mocked, and the MockWith script block can contain references to the -mocked commands parameter variables. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: {} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Verifiable -When this is set, the mock will be checked when Assert-VerifiableMocks is -called. - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ParameterFilter -An optional filter to limit mocking behavior only to usages of -CommandName where the values of the parameters passed to the command -pass the filter. - -This ScriptBlock must return a boolean value. -See examples for usage. - -```yaml -Type: ScriptBlock -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: {$True} -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -ModuleName -Optional string specifying the name of the module where this command -is to be mocked. -This should be a module that _calls_ the mocked -command; it doesn't necessarily have to be the same module which -originally implemented the command. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 4 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[Assert-MockCalled](Assert-MockCalled.md) - -[Assert-VerifiableMocks](Assert-VerifiableMocks.md) - -[Describe](Describe.md) - -[Context](Context.md) - -[It](It.md) - -[about_Should]() - -[about_Mocking]() diff --git a/reference/6/Pester/New-Fixture.md b/reference/6/Pester/New-Fixture.md deleted file mode 100644 index 3453128a1bf4..000000000000 --- a/reference/6/Pester/New-Fixture.md +++ /dev/null @@ -1,115 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# New-Fixture - -## SYNOPSIS -This function generates two scripts, one that defines a function -and another one that contains its tests. - -## SYNTAX - -``` -New-Fixture [[-Path] ] [-Name] -``` - -## DESCRIPTION -This function generates two scripts, one that defines a function -and another one that contains its tests. -The files are by default -placed in the current directory and are called and populated as such: - - -The script defining the function: .\Clean.ps1: - -function Clean { - -} - -The script containg the example test .\Clean.Tests.ps1: - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") -. -"$here\$sut" - -Describe "Clean" { - - It "does something useful" { - $false | Should Be $true - } -} - -## EXAMPLES - -### -------------------------- EXAMPLE 1 -------------------------- -``` -New-Fixture -Name Clean -``` - -Creates the scripts in the current directory. - -### -------------------------- EXAMPLE 2 -------------------------- -``` -New-Fixture C:\Projects\Cleaner Clean -``` - -Creates the scripts in the C:\Projects\Cleaner directory. - -### -------------------------- EXAMPLE 3 -------------------------- -``` -New-Fixture Cleaner Clean -``` - -Creates a new folder named Cleaner in the current directory and creates the scripts in it. - -## PARAMETERS - -### -Path -Defines path where the test and the function should be created, you can use full or relative path. -If the parameter is not specified the scripts are created in the current directory. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: $PWD -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Name -Defines the name of the function and the name of the test to be created. - -```yaml -Type: String -Parameter Sets: (All) -Aliases: - -Required: True -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - -[about_Pester](https://github.com/pester/Pester/blob/master/en-US/about_Pester.help.txt) - -[about_Should](https://github.com/pester/Pester/blob/master/en-US/about_Should.help.txt) - diff --git a/reference/6/Pester/Pester.md b/reference/6/Pester/Pester.md deleted file mode 100644 index 3f1e6ee9b3d6..000000000000 --- a/reference/6/Pester/Pester.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-US -keywords: powershell,cmdlet -Help Version: 6.0 -Download Help Link: http://Please-enter-FwLink-manually -Module Guid: a699dea5-2c73-4616-a270-1f7abb777e71 -Module Name: Pester ---- - -# Pester Module -## Description -{{Manually Enter Description Here}} - -## Pester Cmdlets -### [AfterAll](AfterAll.md) -{{Manually Enter AfterAll Description Here}} - -### [AfterEach](AfterEach.md) -{{Manually Enter AfterEach Description Here}} - -### [Assert-MockCalled](Assert-MockCalled.md) -{{Manually Enter Assert-MockCalled Description Here}} - -### [Assert-VerifiableMocks](Assert-VerifiableMocks.md) -{{Manually Enter Assert-VerifiableMocks Description Here}} - -### [BeforeAll](BeforeAll.md) -{{Manually Enter BeforeAll Description Here}} - -### [BeforeEach](BeforeEach.md) -{{Manually Enter BeforeEach Description Here}} - -### [Context](Context.md) -{{Manually Enter Context Description Here}} - -### [Describe](Describe.md) -{{Manually Enter Describe Description Here}} - -### [Get-MockDynamicParameters](Get-MockDynamicParameters.md) -{{Manually Enter Get-MockDynamicParameters Description Here}} - -### [Get-TestDriveItem](Get-TestDriveItem.md) -{{Manually Enter Get-TestDriveItem Description Here}} - -### [In](In.md) -{{Manually Enter In Description Here}} - -### [InModuleScope](InModuleScope.md) -{{Manually Enter InModuleScope Description Here}} - -### [Invoke-Mock](Invoke-Mock.md) -{{Manually Enter Invoke-Mock Description Here}} - -### [Invoke-Pester](Invoke-Pester.md) -{{Manually Enter Invoke-Pester Description Here}} - -### [It](It.md) -{{Manually Enter It Description Here}} - -### [Mock](Mock.md) -{{Manually Enter Mock Description Here}} - -### [New-Fixture](New-Fixture.md) -{{Manually Enter New-Fixture Description Here}} - -### [Set-DynamicParameterVariables](Set-DynamicParameterVariables.md) -{{Manually Enter Set-DynamicParameterVariables Description Here}} - -### [Setup](Setup.md) -{{Manually Enter Setup Description Here}} - -### [Should](Should.md) -{{Manually Enter Should Description Here}} diff --git a/reference/6/Pester/Set-DynamicParameterVariables.md b/reference/6/Pester/Set-DynamicParameterVariables.md deleted file mode 100644 index 4a21e44ff096..000000000000 --- a/reference/6/Pester/Set-DynamicParameterVariables.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Set-DynamicParameterVariables - -## SYNOPSIS -This command is used by Pester's Mocking framework. -You do not need to call it directly. - -## SYNTAX - -``` -Set-DynamicParameterVariables [-SessionState] [[-Parameters] ] - [[-Metadata] ] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -SessionState -{{Fill SessionState Description}} - -```yaml -Type: SessionState -Parameter Sets: (All) -Aliases: - -Required: True -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Parameters -{{Fill Parameters Description}} - -```yaml -Type: Hashtable -Parameter Sets: (All) -Aliases: - -Required: False -Position: 2 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Metadata -{{Fill Metadata Description}} - -```yaml -Type: CommandMetadata -Parameter Sets: (All) -Aliases: - -Required: False -Position: 3 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -## OUTPUTS - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Setup.md b/reference/6/Pester/Setup.md deleted file mode 100644 index bcaeb69b3c38..000000000000 --- a/reference/6/Pester/Setup.md +++ /dev/null @@ -1,121 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Setup - -## SYNOPSIS -{{Fill in the Synopsis}} - -## SYNTAX - -``` -Setup [-Dir] [-File] [[-Path] ] [[-Content] ] [-PassThru] -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -Content -{{Fill Content Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 1 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Dir -{{Fill Dir Description}} - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -File -{{Fill File Description}} - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -PassThru -{{Fill PassThru Description}} - -```yaml -Type: SwitchParameter -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Path -{{Fill Path Description}} - -```yaml -Type: Object -Parameter Sets: (All) -Aliases: - -Required: False -Position: 0 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -## INPUTS - -### None - - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS - diff --git a/reference/6/Pester/Should.md b/reference/6/Pester/Should.md deleted file mode 100644 index eecaa08574ea..000000000000 --- a/reference/6/Pester/Should.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -ms.date: 2017-06-09 -schema: 2.0.0 -locale: en-us -keywords: powershell,cmdlet -external help file: Pester-help.xml ---- - -# Should - -## SYNOPSIS -{{Fill in the Synopsis}} - -## SYNTAX - -``` -Should -``` - -## DESCRIPTION -{{Fill in the Description}} - -## EXAMPLES - -### Example 1 -``` -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -## INPUTS - -### None - - -## OUTPUTS - -### System.Object - -## NOTES - -## RELATED LINKS -