PowerShell/test/xUnit/csharp
Dongbo Wang c606b1ca37 Refactor ConvertTo-Json to expose JsonObject.ConvertToJson as a public API (#8682)
We have the public API `JsonObject.ConvertFromJson` to convert from JSON string in the PowerShell context. It would be good to have a public API for conversion to JSON. This PR refactors the `ConvertTo-Json` cmdlet to move the core implementation to `JsonObject.ConvertToJson`, and make `ConvertTo-Json` call that public method.

This would help the Azure Function PowerShell worker. Currently, we depends on [calling the cmdlet](729710d259/src/PowerShell/PowerShellManager.cs (L198-L205)) to convert object to JSON which is expensive. Once we have the public method `JsonObject.ConvertToJson` exposed, we can call the API directly to avoid a command invocation.
2019-01-23 10:39:12 -08:00
..
test_Binders.cs
test_CorePsPlatform.cs
test_ExtensionMethods.cs
test_FileSystemProvider.cs
test_MshSnapinInfo.cs
test_PSConfiguration.cs
test_PSVersionInfo.cs
test_Runspace.cs
test_SecuritySupport.cs
test_SessionState.cs
test_Utils.cs Refactor ConvertTo-Json to expose JsonObject.ConvertToJson as a public API (#8682) 2019-01-23 10:39:12 -08:00