$parts = "2024", "01", "15" # -join concatenates with a separator $date = $parts -join "-" Write-Output $date
glue an array into a string