你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Export-AzSynapseKqlScript

Exports KQL script.

Syntax

Export-AzSynapseKqlScript
      -WorkspaceName <String>
      [-Name <String>]
      -OutputFolder <String>
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [<CommonParameters>]
Export-AzSynapseKqlScript
      -WorkspaceObject <PSSynapseWorkspace>
      [-Name <String>]
      -OutputFolder <String>
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [<CommonParameters>]
Export-AzSynapseKqlScript
      -InputObject <PSKqlScriptResource>
      -OutputFolder <String>
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [<CommonParameters>]

Description

The Export-AzSynapseKqlScript cmdlet exports an Azure Synapse KQL script to a kusto query (.kql) file. The name of the KQL script becomes the name of the exported file. If you specify the name of a KQL script, the cmdlet exports that KQL script. If you do not specify a name, the cmdlet export all KQL scripts in the workspace.

Examples

Example 1

Export-AzSynapseKqlScript -WorkspaceName ContosoWorkspace -OutputFolder "C:\KqlScirpt"

Exports all KQL scripts in the workspace ContosoWorkspace to the folder "C:\KqlScirpt".

Example 2

Export-AzSynapseKqlScript -WorkspaceName ContosoWorkspace -Name ContosoKqlScript -OutputFolder "C:\KqlScript"

Exports a single KQL script called ContosoKqlScript in the workspace ContosoWorkspace to the folder "C:\KqlScript".

Example 3

$ws = Get-AzSynapseWorkspace -Name ContosoWorkspace
$ws | Export-AzSynapseKqlScript -Name ContosoKqlScript -OutputFolder "C:\KqlScript"

Exports a single KQL script called ContosoKqlScript in the workspace ContosoWorkspace to the folder "C:\KqlScript" through pipeline.

Example 4

$KqlScript = Get-AzSynapseKqlScript -WorkspaceName ContosoWorkspace -Name ContosoKqlScript
$KqlScript | Export-AzSynapseKqlScript -OutputFolder "C:\KqlScript"

Exports a single KQL script called ContosoKqlScript in the workspace ContosoWorkspace to the folder "C:\KqlScript" through pipeline.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

KQL script object.

Type:PSKqlScriptResource
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

KQL script name.

Type:String
Aliases:KqlScriptName
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OutputFolder

The folder where the KQL script should be placed.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WorkspaceName

Name of Synapse workspace.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WorkspaceObject

workspace input object, usually passed through the pipeline.

Type:PSSynapseWorkspace
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PSSynapseWorkspace

PSKqlScriptResource

Outputs

FileInfo