我需要在 Azure Runbooks 中使用以下命令:
New-AzureRmDataFactoryLinkedService $MyDataFactoryObject -File "PATH/TO/JSON/STRING/FILE"
我想知道是否可以传递 JSON 对象本身而不是传递文件路径?
我的意思是这样的:
$StorageLinkedService_JSON_str = '{
"name": "StorageName",
"properties": {
"type": "AzureStorage",
"description": "",
"typeProperties": {
"connectionString": "connectionString"
}
}
}'
$StorageLinkedService_Obj = ConvertFrom-Json -InputObject $StorageLinkedService_JSON_str
# I need to know is it possible to use one of these lines?
# New-AzureRmDataFactoryLinkedService $MyDataFactoryObject -File $StorageLinkedService_JSON_str
# OR This:
# New-AzureRmDataFactoryLinkedService $MyDataFactoryObject -File $StorageLinkedService_Obj