Relative Content

Tag Archive for windowspowershell

Script Execution from PowerShell ISE vs. Run with PowerShell Gives Different Screen Sizes for Multiple Displays

My laptop is connected to two additional HDMI monitors of different models. The PowerShell script reports sizes and positions of the three display screens. The display working areas are reported different when script is executed from a PS console rather than from within PS ISE. There is no difference in computer or monitor setups which ever “PS environment” is used. This results in windows placed on screens are different sizes and positions and mouse movement locations.

Restart service quietly

I have an application where i need to restart the service for that application in windows 10 every hour. Is there a powershell script or a background restart of some sort that can be user to restart the service ?

Powershell script failing to identify file

After the Crowd Strike debacle I have multiple Windows servers that have large .dmp files I am attempting to delete. I have come up with that attached powershell script with no success. I have tried using the admin share path as well with no success. I have tried removing the variables and typing out the path and each time it returns, “Path does not exist.” I have also attempted running in an admin console, rebooting the server to make sure the file isnt still in use, I have manually deleted the same file without issue. I am at a loss. Can someone that knows more about Powershell than myself help? Please. I sincerely appreciate any assistance.