## Tuesday, June 18, 2013

### %systemdrive% in Powershell

I was just trying to write a script to manage IIS logs. I was able to get the log directory, but it comes back as  %SystemDrive%\inetpub\logs\LogFiles

Reading between the lines from a couple of posts, I found that I can use \$env:SystemDrive in place of %SystemDrive%

So I can do something like this: