What is my IP Address?

I got fed up with using other people’s pages to check public IP addresses, so have put our own checker on our main website:

https://sfax.co.uk/ip

Google will tell you your IP address if you google “what is my ip address” but when you are on unfamiliar systems you may find the default search engine is Bing or something stupid like that.

So now I have a nice quick url to look it up on.

Deleting files over a certain age

We sometimes find the need to delete all files from a folder over a certain age. For example we have a folder that our network scanner dumps its scans in. Ideally everyone would file their scans straight away, but it doesn’t always happen.

So we have the following script running every hour that removes all files from the folder that are over an hour old.

Get-ChildItem –Path "C:\scans" -Recurse | Where-Object {($_.LastWriteTime -lt (Get-Date).AddMinutes(-60))} | Remove-Item

You can change .AddMinutes to .AddHours, .AddDays or AddMonths as appropriate.