Any help or advice please, i am trying to update Microsoft Teams - Local User.
Line 3 shows error: as STATUS: Running action…
Command failed (Relevance substitution failed) parameter "manifest"="{pathname of file "manifest.txt" of client folder of site "actionsite"}"
Command failed (Relevance clauses must be surrounded by { and } guards.) parameter "manifest"="{pathname of file "manifest.txt" of client folder of site "actionsite"}"
--- Result ---
Evaluation failed!dont know what
===================================================================================
// begin prefetch block
collect prefetch items
parameter "manifest"="{pathname of file "manifest.txt" of client folder of site "actionsite"}"
add prefetch item {following text of first ":" of line whose (it contains "current.zip") of file (parameter "manifest")}
end prefetch block
folder delete "C:\ProgramData\xxx\Teams"
folder create "C:\ProgramData\xxx\Teams"
copy "__Download\current.zip" "C:\ProgramData\xxx\Teams\current.zip"
action uses wow64 redirection {not x64 of operating system}
// Begin PowerShell script
delete __createfile
createfile until POWERSHELL
# Get the Teams version number from the swver.txt file which we will use later when determing whether a Teams.exe file need to be updated
[system.version]$swverTeamsFileVersion = ((Get-Content -Path "C:\Program Files (x86)\BigFix Enterprise\BES Client\__BESData\actionsite\swver.txt" -ErrorAction SilentlyContinue | Where-Object {{$_ -like '*teams,win*'}).Split(","))[2]
# Get the currently logged in user - if there is one - as we do not want to replace Teams out from under their active use of it
$theLoggedInUser = quser | findstr "Active"
$theLoggedInUser = $theLoggedInUser.Remove(0,1)
$theLoggedInUser = $theLoggedInUser.Split(" ")
$theLoggedInUser = $theLoggedInUser[0]
# Get a list of all the user profile folders
$userDirs = (Get-ChildItem -Path "C:\Users" -Directory).FullName
# Iterate through each user profile folder
foreach ($user in $userDirs)
{{
# Get just the username - the user variable has NIH\ in front of it
$username = $user.Split("\")
$username = $username[$username.Count - 1]
# Check to see if the current user profile folder being examined is the currently logged in user
if ($username -ne $theLoggedInUser)
{{
# This is not the currently logged in user
# Now we need to determine if there is even a Teams.exe file in the profile - we don't want to put a copy of the product where it did not already exist
if (Test-Path -Path "C:\Users\$username\AppData\Local\Microsoft\Teams\current")
{{
# Check and see if the Teams.exe file in this user profile is less than the one in the swver.txt file
if ([system.version](((Get-Item "C:\Users\$username\AppData\Local\Microsoft\Teams\current\Teams.exe").VersionInfo.FileVersionRaw).ToString()) -lt $swverTeamsFileVersion)
{{
# The Teams.exe file in this user profile folder is less than the one in the swver.txt file so we will delete the current folder
Remove-Item -Path "C:\Users\$username\AppData\Local\Microsoft\Teams\current" -Recurse -Force -ErrorAction SilentlyContinue
# Extract the contents of the .ZIP file into this user profile folder - this creates a new current folder with the updated Teams.exe file
Expand-Archive -Path "c:\ProgramData\xxx\Teams\current.zip" -DestinationPath "C:\Users\$username\AppData\Local\Microsoft\Teams" -Force -ErrorAction SilentlyContinue
}
else
{{
# The Teams.exe version in this user profile is up-to-date so there is no need to do anything further
}
}
else
{{
# There was no Teams.exe in this user profile folder so there is nothing further to do
}
}
else
{{
# This is the logged in user so we do not want to do anything further
}
}
# Clean up after ourselves
Remove-Item "c:\ProgramData\xxx\Teams\current.zip"
Remove-Item -Path "c:\ProgramData\xxx\Teams" -Recurse -Force -ErrorAction SilentlyContinue
POWERSHELL
delete "c:\ProgramData\xxx\Teams\teams.ps1"
copy __createfile c:\ProgramData\xxx\Teams\teams.ps1
waithidden { pathname of file ((it as string) of value "Path" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" of native registry) } -ExecutionPolicy Bypass -File "c:\ProgramData\xxx\Teams\teams.ps1"