powershell - 在Powershell中使用UFormat转换时为什么会出现语法错误

标签 powershell

为什么不能将此日期转换为Unix DateTime:我遇到了语法错误

([DateTime]"2015.08.24 09:10") -UFormat %s

什么是正确的语法?

最佳答案

UFormatGet-Date的cmdlet参数,不是独立的运算符。试试这个:

 Get-Date '2015.08.24 09:10' -UFormat %s

关于powershell - 在Powershell中使用UFormat转换时为什么会出现语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32619741/

相关文章:

sql-server - 将 CSV 从 PowerShell 导入到 SQL Server

powershell - 如何在 PowerShell 中检索 IIS 网站的 SSL 证书

powershell - 复制项目将2条语句合并为1条

rest - powershell http发布REST API基本身份验证

function - PowerShell 模块设计 - Export-ModuleMember

powershell - 如何简单地提取路径的前N个部分?

powershell - Powershell属性计数

powershell - AzureProfile.json 上的多个 Runbook 访问被拒绝

powershell - 如何通过 "killed"或任务管理器在我的进程为 "stop-process"时运行 PowerShell 函数?

regex - Powershell - notMatch