Best Productivity Tips For Windows Support Personnel

When you are working on support call, often times you end up dragging the Windows Explorer columns to see the complete name/details of files.  The very effective would be is to use “Size All Columns to Fit” option that comes when you right click on any of the explorer column title bar ———————————————————————————————————————- During the support calls, you often also require to type the path of a file that is very long and this can be tedious task and is error prone.  To make this doing this task easier, you can simply rely on Explorer Context menu option called “Copy […]

Read more

Implementing logging (to log file) in Powershell Scripts

Many of the times one requires to setup logging for a script that is very huge in code and/or critical in it’s activities.  Here is a quick PS function code that I authored which simply logs all the log statements to a given file (for this example, I used C:tempTest.log file). Code: $LogFile    = ‘C:tempTest.log’ function MyLog {     param ([string]$msg, [int]$flag)     $date = get-date -format MM:dd:yyyy-HH:mm:ss     Write-Output "msg received is [ $msg ] flag received is: [ $flag ]" | Out-File $LogFile -append     if ($flag -eq 0) {         Write-Output "$date INFO: $msg" | Out-File $LogFile […]

Read more

PS: Windows GUI Automation

Very often in automation you require to bring a running process Window to the front and setting it as the active Window for the user. For this you need to run a script like below where you ensure that specified process is running, once you detect that process is running, you select the process Window and then set it as the active Window with maximized position. Code: while (! $IsWindowRunning) {     $IsWindowRunning = select-window -ProcessName excel } select-window -ProcessName excel | set-windowactive | Set-WindowPosition -maximize   In case, you just need to one of have the Window maximized, then […]

Read more