while($version -ne $updatetoversion){Start-Process $UpdateEXE $UpdateArguements -Wait}
this code has no "break" word.
likie this:
while(true){}
always do the same thing. Read some docs about "while".
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I asked this in the PowerShell group and got lots of helpful suggestions and scripts to test, but none of them actually worked properly. I just need PS to check the version of winword and compare it to the latest version we are using and upgrade it if needed, then end.
What I started with was:
$UpdateEXE ="C:\Program Files\Common Files\microsoft shared\ClickToRun\OfficeC2RClient.exe"
2. $UpdateArguements = "/update user displaylevel=true"
3. $updatetoversion="16.0.etc"
4. $version = Get-WmiObject win32_product | where{$_.Name -like "Microsoft Office Professional Plus*"} | Select-Object -ExpandProperty Version
5. while($version -ne $updatetoversion){
6. Start-Process $UpdateEXE $UpdateArguements -Wait
7. }
This checks the version, runs an update, but then stops with a popup:
Your Office has been upgraded, so I have to click OK for the next version check and upgrade to take off.
Some of our pc's are at version 1705, some at 2002....we need 2008.
**So after clicking OK at the popup window, the 2nd upgrade runs, gets me to where I need to be, but then is stuck in a loop of "Checking for Updates" endlessly.
Any idea why this would be?
I know I have a 'while' but I have no condition telling it what to do once the version matches. That part I don't have.
while($version -ne $updatetoversion){Start-Process $UpdateEXE $UpdateArguements -Wait}
this code has no "break" word.
likie this:
while(true){}
always do the same thing. Read some docs about "while".