0

The timestamp is returning a timestamp with a strange format:

"TimeStamp":  {
                      "value":  "\/Date(1674758644068)\/",
                      "DisplayHint":  2,
                      "DateTime":  "jueves, 26 de enero de 2023 12:44:04 p. m."
                  },

The problem is that I want to upload the information to powerBi and it gives me an error, for this I would like to make my script return this type of format:

"TimeStamp": "2022-08-08T19:00:53.0907571-05:00"

In my script the timestamp calls it in this function.

try {
$projectsDataArray = getProjects| ForEach-Object {
    @{ 
        TimeStamp = Get-Date
        ProjectMeta = processProject($_)
    }
}
#****Llamada con el recorrido para obtener el id de cada definiiton
$projectsDataArray | ConvertTo-Json -Depth 8 | Set-Content C:\Users\60085367\Documents\Proyecto3ApiDevOps\NuevaPrueba\devopsmetaFinal.json

}
catch { Write-Output $_ }

1 Answers1

0
TimeStamp = Get-Date -Format "o"
  • While this code snippet may be the solution, including an explanation really helps to improve the quality of your post. Remember that you are answering the question for readers in the future, and those people might not know the reasons for your code suggestion. – Shawn Hemelstrand Jan 27 '23 at 01:18