You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `ConvertTo-JsonForPSWS` cmdlet converts any object to a string in JavaScript Object Notation (JSON) format for PowerShell Web Services. The properties are converted to field names, the field values are converted to property values, and the methods are removed.
21
+
22
+
You can then use the `ConvertTo-JsonForPSWS` cmdlet to convert a JSON-formatted string to a JSON object, which is easily managed in Windows PowerShell.
23
+
24
+
Many web sites use JSON instead of XML to serialize data for communication between servers and web-based apps.
21
25
22
26
## EXAMPLES
23
27
24
28
### -------------------------- Example 1 --------------------------
This command shows the effect of using the Compress parameter of `ConvertTo-JsonForPSWS`. The compression affects only the appearance of the string, not its validity.
53
+
54
+
### -------------------------- Example 3 --------------------------
"DateTime": "domingo, 27 de mayo de 2018 19:01:15",
63
+
"Date": "\/Date(1527390000000)\/",
64
+
"Day": 27,
65
+
"DayOfWeek": {
66
+
"value": 0,
67
+
"Value": "Sunday"
68
+
},
69
+
"DayOfYear": 147,
70
+
"Hour": 19,
71
+
"Kind": {
72
+
"value": 2,
73
+
"Value": "Local"
74
+
},
75
+
"Millisecond": 225,
76
+
"Minute": 1,
77
+
"Month": 5,
78
+
"Second": 15,
79
+
"Ticks": 636630444752251610,
80
+
"TimeOfDay": {
81
+
"Hours": 19,
82
+
"Minutes": 1,
83
+
"Seconds": 15,
84
+
"Ticks": 684752251610,
85
+
"Days": 0,
86
+
"Milliseconds": 225,
87
+
"TotalDays": 0.79253732825231482,
88
+
"TotalHours": 19.020895878055555,
89
+
"TotalMilliseconds": 68475225.161,
90
+
"TotalMinutes": 1141.2537526833335,
91
+
"TotalSeconds": 68475.225161
92
+
},
93
+
"Year": 2018
94
+
}
27
95
```
28
96
29
-
{{ Add example description here }}
97
+
This command shows how to use the `ConvertTo-JsonForPSWS` cmdlet to convert an object to a JSON string for PowerShell Web Services.
98
+
99
+
It uses the `ConvertTo-JsonForPSWS` cmdlet to convert a System.DateTime object from the Get-Date cmdlet to a JSON-formatted string for PowerShell Web Services. The command uses the Select-Object cmdlet to get all () of the properties of the **DateTime* object. The output shows the JSON string that `ConvertTo-JsonForPSWS` returned.
100
+
101
+
### -------------------------- Example 2 --------------------------
This command uses the `ConvertTo-JsonForPSWS` cmdlet to convert a Windows PowerShell Help file from XML format to JSON format for PowerShell Web Services. You can use a command like this to use the Help topic content in a web service application.
30
107
31
108
## PARAMETERS
32
109
33
110
### -Compress
34
-
{{Fill Compress Description}}
111
+
Omits white space and indented formatting in the output string.
Specifies the objects to convert to JSON format. Enter a variable that contains the objects, or type a command or expression that gets the objects. You can also pipe an object to `ConvertTo-JsonForPSWS`.
144
+
145
+
The InputObject parameter is required, but its value can be null ($Null) or an empty string. When the input object is $Null, `ConvertTo-JsonForPSWS` does not generate any output. When the input object is an empty string, `ConvertTo-JsonForPSWS` returns an empty string.
Indicates that this cmdlet runs as a background job.
162
+
163
+
When you specify the AsJob parameter, the command immediately returns an object that represents the background job. You can continue to work in the session while the job finishes. The job is created on the local computer and the results from the Skype for Business Online session are automatically returned to the local computer. To get the job results, use the Receive-Job cmdlet.
164
+
165
+
For more information about Windows PowerShell background jobs, see [about_Jobs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_jobs?view=powershell-6) and [about_Remote_Jobs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_remote_jobs?view=powershell-6).
83
166
84
167
```yaml
85
168
Type: SwitchParameter
@@ -100,14 +183,15 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
0 commit comments