Functions/Enable-OrchUserAttended.ps1

function Enable-OrchUserAttended {
    [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 -MayHaveRobotSession True
    }
}