Search notes:

PowerShell cmdLet ConvertTo-JSON

convertTo-json converts PowerShell objects to JSON documents (a System.String object).
$obj = [psObject] @{
  txt = 'Hello world'
  num =  42
  bla = 'foo', 'bar', 'baz'
}

convertTo-json $obj
#
# {
#   "bla": [
#     "foo",
#     "bar",
#     "baz"
#   ],
#   "txt": "Hello world",
#   "num": 42
# }
Github repository about-PowerShell, path: /cmdlets/json/convertTo/basic.ps1

See also

convertFrom-json parses a string that contains a JSON value to a PowerShell object.
Powershell command noun: json

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1758186292, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/command-inventory/noun/json/convertTo(57): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78