What have you tried?
Where is your code?
What errors are you having?
Native PowerShell is not designed to be a GUI management tool.
You can do it, but there is no built-in cmdlet to do so.
You have to lean on either SendKeys, .Net, or 3rd Party add-on or tools.
Simple notepad example with SendKeys: (as long as your app is not minimized)...
So, start notepad, click another app to ring it to foreground, then run the code below, which should brig notepad to the foreground.
[void] [System.Reflection.Assembly]::LoadWithPartialName("'Microsoft.VisualBasic")
[Microsoft.VisualBasic.Interaction]::AppActivate((Get-Process -Name notepad).MainWindowTitle)
… if it is minimized, then that will not work. More code is needed to restore minimized windows. I'll leave that as a homework assignment for you.
Thanks | What I tried is searching! I'm new in powershell scripting. I read some manuals and searched. So I couldn't implement it, then no error! | Mine is a simple loop calling that snippet as a function, described here: https://superuser.com/q/1419761/1014819 | Homework?! :'(
– shal – 2019-04-02T15:10:35.927See the update I posted relative to the link you supplied here. – postanote – 2019-04-03T02:02:57.450