I’ve been wanting to create a PowerCli script to automatically configure a scratch file location if one did not exist. This script would come in handy when moving to a new lun for the scratch location. After some quick google fu I came across a great script that met my requirements plus a little more.
Check out the post over at http://miklm.com/2018/01/configure-scratch-location-with-powercli/
In addition to creating the needed scratch file location this script indicates if it is already created and if the vmhost needs a reboot to complete the process. A csv file is created with a list of all the hosts that need a reboot. I made two small changes to the script. I added the cluster name to the exported name of the csv file. A disconnect-viserver command was added to the end of the script.
Feel free to comment and give suggestions on how to improve this script or any others I have shared. While you’re here check out my Schannel Set-Crypto PowerCLi Script Feedback is always appreciated.