Powershell 2.0格式列表输出到JSON吗? [英] Powershell 2.0 Format-list output to JSON?
本文介绍了Powershell 2.0格式列表输出到JSON吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
PS B:\abrabackups> . C:\ps\ConvertTo-JSON.ps1
PS B:\abrabackups> Get-ItemProperty -Path .\AbraSuite01.03.2014 | select Name,CreationTime | ConvertTo-JSON
这给了我:(为清楚起见而格式化)
{
"CreationTime": "2014-01-03T16:48:36",
"Name": "AbraSuite01.03.2014"
}
这很好,但是假设我希望我的日期以JSON字符串的其他格式显示,无论如何都可以在powershell中执行此操作,并且仍然使用我的
Well that's all well and good, but suppose I want my dates in a different format in the JSON string, is there anyway to do this in powershell and still use my shoehorned ConvertTo-JSON.ps1 for powershell 2.0?
推荐答案
查看全文