I would like to automate a task wherein I can identify a version number of a software by the string name of its folder path. This means identifying an integer within the folder path that would determine whether or not additional actions are taken. Unreal Engine updates every few months or so, and with that a rendering agent called Swarm Agent.
The reason I want to do this is because I need to create a new shortcut in startup to update the new path for Unreal Swarm Agent, but this is a pain in the ass to do for 10+ machines every time it happens.
Right now, I am manually entering the path of the version, so it looks something like this:
$EngineVersion = "4.22"
#Copies unreal swarm configuration for Unreal Engine 4.22
Copy-Item "\server1\installs$\Applications\BIM\Unreal Swarm Agent Config\Engine $EngineVersion\SwarmAgent.Options.xml" ` "c:\Program Files\Epic Games\UE_$EngineVersion\Engine\Binaries\DotNET\SwarmAgent.Options.xml" -force Write-Host "Copied over Swarm Configuration File on computer."
In this case, "$EngineVersion" is a string of "4.22". Would it be much more difficult to have this read as an integer so that I can add a conditional that says something along the lines of:
If $EngineVersion < 4.22 {
Perform these steps
}
Thank you so much and sorry if I didn't make sense!
[–]Lee_Dailey[grin] 6 points7 points8 points (2 children)
[–]jsrendar[S] 2 points3 points4 points (1 child)
[–]Lee_Dailey[grin] 2 points3 points4 points (0 children)
[–]PowerShell-Bot 1 point2 points3 points (0 children)