Functions/Enable-OrchPersonalWorkspace.ps1

function Enable-OrchPersonalWorkspace {
    [CmdletBinding(SupportsShouldProcess = $true)]
    Param (
        [Parameter(Position = 0, Mandatory = $true, ValueFromPipelineByPropertyName = $true)]
        [SupportsWildcards()]
        [ArgumentCompleter([UiPath.PowerShell.Completer.TenantUserNameCompleter[UiPath.PowerShell.Positional.UserName]])]
        [string[]]$UserName,

        [Parameter(ValueFromPipelineByPropertyName = $true)]
        [ArgumentCompleter([UiPath.PowerShell.Completer.DriveCompleter[UiPath.PowerShell.Positional.UserName]])]
        [string[]]$Path
    )

    foreach ($user in $UserName) {
        Update-OrchUser @PSBoundParameters -Path $Path -UserName $user -MayHavePersonalWorkspace True -MayHaveRobotSession True
    }
}