Edit

Share via


Export-AzSynapseKqlScript

Exports KQL script.

Syntax

ExportByName (Default)

Export-AzSynapseKqlScript
    -WorkspaceName <String>
    -OutputFolder <String>
    [-Name <String>]
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

ExportByObject

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

ExportByInputObject

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:\KqlScript"

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

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

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

KQL script object.

Parameter properties

Type:PSKqlScriptResource
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ExportByInputObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

KQL script name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:KqlScriptName

Parameter sets

ExportByName
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
ExportByObject
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OutputFolder

The folder where the KQL script should be placed.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WorkspaceName

Name of Synapse workspace.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ExportByName
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WorkspaceObject

workspace input object, usually passed through the pipeline.

Parameter properties

Type:PSSynapseWorkspace
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

ExportByObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSSynapseWorkspace

PSKqlScriptResource

Outputs

FileInfo