public static ExtractNameFromJson ( string jsonText, string resourceType ) : string | ||
jsonText | string | |
resourceType | string | |
return | string |
protected string ResolveResourceName(string rawJsonContent, string nameFromCmdletContext, string resourceType) { string nameExtractedFromJson = DataFactoryCommonUtilities.ExtractNameFromJson(rawJsonContent, resourceType); // Read the name from the JSON content if user didn't provide name with -Name parameter string resolvedResourceName = string.IsNullOrWhiteSpace(nameFromCmdletContext) ? nameExtractedFromJson : nameFromCmdletContext; // Show a message that if names do not match, name specified with -Name parameter will be used. if (string.Compare(resolvedResourceName, nameExtractedFromJson, StringComparison.OrdinalIgnoreCase) != 0) { WriteVerbose(string.Format( CultureInfo.InvariantCulture, Resources.ExtractedNameFromJsonMismatchWarning, resourceType, resolvedResourceName, nameExtractedFromJson)); } return(resolvedResourceName); }