Hi, I’m working on a script, where i need to import userprofiles from a profile archive to be terminated, to a new profile area during login. This will be running as a logon task with Horizon Vmware DEM.
This Script works, because there is no space in chrome.zip:
$ProfArchPath = @()
$ProfArchPath = (Get-ItemPropertyValue -Path 'HKCU:\Software\Policies\Immidio\Flex Profiles\Arguments' -Name 'ProfileArchivePath') + "\Applications\Chrome.zip"
$PathToFlex = "C:\Program Files\Immidio\Flex Profiles"
try {
Start-Process "FlexEngine.Exe" -WorkingDirectory $PathToFlex -ArgumentList " -r $ProfArchPath"
}
catch
{
Write-Warning $Error[0]
}
But when i want to import Mozilla Firefox profile with a space before .zip, with this script:
$ProfArchPath = @()
$ProfArchPath = (Get-ItemPropertyValue -Path 'HKCU:\Software\Policies\Immidio\Flex Profiles\Arguments' -Name 'ProfileArchivePath') + "\Applications\Mozilla Firefox.zip"
$PathToFlex = "C:\Program Files\Immidio\Flex Profiles"
try {
Start-Process "FlexEngine.Exe" -WorkingDirectory $PathToFlex -ArgumentList " -r $ProfArchPath"
}
catch
{
Write-Warning $Error[0]
}
i get this error message:
Any idea?