[dba-Tech] PowerShell - formatting output

John Bartow jbartow at winhaven.net
Mon Mar 10 14:42:14 CDT 2014


Is anyone on this list familiar with PowerShell formatting?

I want to grab a datetime value out of an xml file and output it in a
friendly display rather than what I'm getting now: 2015-01-20T00:00:00

Try {
	$xml = [xml](get-content C:\ProgramData\ACME\RegistrationConfig.xml)
#C:\Programdata\RegistrationConfig.xml
	Write-Host "Expiration Date"$xml.RegistrationConfig.ExpireDate
	exit 0
	}
Catch {
	Write-Host "Failure"
	exit 1001
	  }

TIA
John B



More information about the dba-Tech mailing list