#PSTip Get old files based on LastWriteTime
Note: This tip requires PowerShell 2.0 and above There are many ways to get the age of a file. The most common way is to subtract the file’s LastWriteTime from the current time:
Read MoreNote: This tip requires PowerShell 2.0 and above There are many ways to get the age of a file. The most common way is to subtract the file’s LastWriteTime from the current time:
Read MoreWhen working with dates in PowerShell it is often useful to leverage the .NET Framework System.DateTime class. For example to display the current date and time the Now method can be used:
Read MoreNote: This tip requires PowerShell 2.0 and above I have always wanted to see what all PowerShell profiles are defined and in-use on a system.
Read MoreIn the last tip, I showed you how to create an enumeration object on which we can do bitwise operations to derive combinational values.
Read MoreAt times, we may want to create an enumeration object in which a combination of different constants means different values or descriptions.
Read MoreIn PowerShell 3.0, we no longer have to import modules manually to use cmdlets. When we run a cmdlet, Windows PowerShell imports the module that contains the command automatically.
Read More