Menu Close

Tag: code

Two new scripts on GitHub

I’ve published two new PowerShell scripts on GitHub: https://github.com/obs0lete/Grant-Admin – Used for grant local administrator rights on remove machine. https://github.com/obs0lete/Revoke-Admin – Used to revoke administrator rights on remote machines. I will (slowly) be adding a bunch of my scripts on my GitHub repo: https://github.com/obs0lete Enjoy!

Weather information in Powershell console – Updated

With inspiration from https://www.reddit.com/r/PowerShell/comments/3zf0b8/getweather_get_the_current_weather_of_your/ and http://wttr.in/ I’ve written a function for Powershell where you can get current weather conditions whenever you launch the console! Make sure to add this function to your Powershell profile and call it via Get-Weather to have it automatically run. You can find the script on…

Delete files older than X days

Here’s a quick portion of a PowerShell script I used that will delete files older than X dates from the current date. 123 $path = “path-to-folder”$days= (Get-Date).AddDays(-7)Get-ChildItem -Path $path -Force | Where-Object { !$_.PSIsContainer -and $_.CreationTime -lt $days} | Remove-Item -Force Simply change $days to the number of days. In…

ATI audio distortion on Kodi

I use Kodi as my HTPC software of choice. In the bedroom I am using a Raspberry Pi 2 running OpenElec which I have had absolutely zero issues with. As for the living room setup, I can’t say the same. For this setup, I am using a fairly descent desktop…