Fellow DBAs
I have completed the test for the tempdb scenario.
yes, for TempDB, you can run your size change script in the same code along with the location change script. Then restart. It works fine.
But I did uncover a scenario that explains why some say that when you change the tempdb initial size you have to restart sql and others say you do not.
I was testing with SQL 2016
1 - You want to increase your tempdb mdf/ndf files to be consistent. You change the size with the guid to be the same. Look at the script. It is simply using Alter Database...... size... ). That did NOT need a restart.
2 - But, if you want to reduce the intial size, like in my situation, it is different. Lets say your multi tempdb files were never aligned right - some where 5 gb, some where 1 gb and you saw lots of free space on the larger ones. Thus you might choose to take initial size down. I wanted 1024 mb. If you do this in the gui, and then generate the sql script, you will find a shrinkfile command with your new size. That is fine but if tempdb is in use, you likely will not be able to get the size down. That is also what happended to me in the beginning. Actually some of the files did shrink a tad but no where near enough. In that scenario, you have to use the Alter Database ..... Size.... command. Then do a restart.
Thx
MG