Although I’m using the New-EventLog cmdlet in the previous one-liner, it actually doesn’t create a new eventlog, instead it creates a new ‘source’ for the existing application log.
that works great, but im having a problem where there’s more than one drive with shadow copy enabled. I assume this is because there would be two .LatestShadowCopy in the output (one for each drive) I tried putting a for each in the if statement but that didn’t seem to work. Any ideas?
Could you please clarify what you’re having a problem with? Is it writing to the event log? Formatting a message? You said you’re, “having a problem where there’s more than one drive…” but you didn’t say what, exactly, the problem was. If you’re able to provide some more detail on what you want to happen, and what problem you’re having, it might be easier for folks to offer advice.