I referenced many threads on this and other forums, but not able to get this script to work in script form in ps or in bat or cmd file.
These commands work interactiv