Wbadmin & powershell - latest backup version identifier -
i need latest backups version identifier in powershell script. if run wbadmin versions, list of backups , last 1 one need.
is there way kind of select top 1 version identifier backups order date
or parsing wbadmin output , getting this.
edit
it may windows.serverbackup module , versionid of get-wbbackupset i'm looking still need parsing this.
versionid : 04/17/2013-21:00 backuptime : 17/04/2013 22:00:55 backuptarget : u: recoverableitems : volumes, systemstate, applications, files, baremetalrecovery volume : {system reserved, local disk (c:), local disk (i:), local disk (o:)...} application : {"cluster", "registry", "microsoft hyper-v vss writer"} vssbackupoption : vssfullbackup snapshotid : 58999c7d-dfbf-4272-a5b9-21361d171486
give try, use -last instead of -first last item:
get-wbbackupset | sort-object backuptime | select-object -first 1 -expandproperty versionid
you can play order of sorting -ascending switch
Comments
Post a Comment