Hi guys,
I have a PowerShell script that basically pulls out each user and their assigned license from our partner portal. I had trouble getting the output in a runbook so thought I would try a desktop flow. This is the flow:

This is the PowerShell script:
$ApplicationId = 'xxx'
$ApplicationSecret = 'xxx' | Convertto-SecureString -AsPlainText -Force
$TenantID = 'xxx'
$RefreshToken = 'xxx'
$ExchangeRefreshToken = 'xxx'
$credential = New-Object System.Management.Automation.PSCredential($ApplicationId, $ApplicationSecret)
$aadGraphToken = New-PartnerAccessToken -ApplicationId $ApplicationId -Credential $credential -RefreshToken $refreshToken -Scopes 'https://graph.windows.net/.default' -ServicePrincipal -Tenant $tenantID
$graphToken = New-PartnerAccessToken -ApplicationId $ApplicationId -Credential $credential -RefreshToken $refreshToken -Scopes 'https://graph.microsoft.com/.default' -ServicePrincipal -Tenant $tenantID
Import-Module MSOnline
Connect-MsolService -AdGraphAccessToken $aadGraphToken.AccessToken -MsGraphAccessToken $graphToken.AccessToken
$customers = Get-MsolPartnerContract -All
Write-Host "Found $($customers.Count) customers for $((Get-MsolCompanyInformation).displayname)." -ForegroundColor DarkGreen
$CSVpath = "%TempFile%"
foreach ($customer in $customers) {
Write-Host "Retrieving license info for $($customer.name)" -ForegroundColor Green
$licensedUsers = Get-MsolUser -TenantId $customer.TenantId -All | Where-Object {$_.islicensed}
foreach ($user in $licensedUsers) {
Write-Host "$($user.displayname)" -ForegroundColor Yellow
$licenses = $user.Licenses
$licenseArray = $licenses | foreach-Object {$_.AccountSkuId}
$licenseString = $licenseArray -join ", "
Write-Host "$($user.displayname) has $licenseString" -ForegroundColor Blue
$licensedSharedMailboxProperties = [pscustomobject][ordered]@{
CustomerName = $customer.Name
DisplayName = $user.DisplayName
Licenses = $licenseString
TenantId = $customer.TenantId
UserPrincipalName = $user.UserPrincipalName
}
$licensedSharedMailboxProperties | Export-CSV -Path $CSVpath -Append -NoTypeInformation
}
}
#***End of script***
The flow is failing on step 3

Microsoft.Flow.RPA.Desktop.Modules.SDK.ActionException: Import failed. Error while parsing ---> System.ArgumentException: Illegal characters in path.
at System.IO.LongPathHelper.Normalize(String path, UInt32 maxPathLength, Boolean checkInvalidCharacters, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at Microsoft.VisualBasic.FileIO.FileSystem.NormalizePath(String Path)
at Microsoft.VisualBasic.FileIO.TextFieldParser.ValidatePath(String path)
at Microsoft.VisualBasic.FileIO.TextFieldParser.InitializeFromPath(String path, Encoding defaultEncoding, Boolean detectEncoding)
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.ReadFromCSVFileAction.Execute(ActionContext context)
--- End of inner exception stack trace ---
at Microsoft.Flow.RPA.Desktop.Modules.File.Actions.ReadFromCSVFileAction.Execute(ActionContext context)
at Microsoft.Flow.RPA.Desktop.Robin.Engine.Execution.ActionRunner.Run(IActionStatement statement, Dictionary`2 inputArguments, Dictionary`2 outputArguments)
What are the illegal characters?
Thanks,
David