Scenario:
I have an output file that has the following inside of it:
Product A
Product B
Product C
I can have powershell say: If (Product A) then execute this If (Product B) then execute this If (Product C) then execute this
But what is the best way to have it copy Products A-C from ServerA to Client A, then execute Product A, B, and C in order? When I say execute I mean install(Products A,B,C are programs)
Would a switch be the best path?
Switch ($products)
Product A {}
Product B {}
Product C {}
Are you still trying to re-invent the wheel? You really should have a look to the Microsoft Deployment Toolkit. It is made for scenarios like yours. And it will make your life easier.
To copy files oder folders you can use ‘Copy-Item’ or if it’s more than just a few files you should use ‘robocopy’.
Hi Justin, PowerShell can do a lot of things. Yes, a switch statement could solve your problem. But, to understand your challenge, please provide us some code that you already tried to provide you some assistance.