Skip to content

Commit

Permalink
Added Export-QlikMetadata cmdlet
Browse files Browse the repository at this point in the history
  • Loading branch information
ahaydon committed Jun 1, 2018
1 parent 65d40ec commit 6afc0de
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Qlik-Cli.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'Qlik-Cli.psm1'

# Version number of this module.
ModuleVersion = '1.9'
ModuleVersion = '1.10'

# ID used to uniquely identify this module
GUID = '730275fa-35db-42e2-9400-eac7e3043ea4'
Expand Down
31 changes: 31 additions & 0 deletions resources/proxy.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,37 @@ function Add-QlikVirtualProxy {
}
}

function Export-QlikMetadata {
[CmdletBinding()]
param (
[parameter(Mandatory=$true,ValueFromPipelinebyPropertyName=$true,Position=0)]
[string]$id,
[parameter(Position=1)]
[string]$filename
)

PROCESS {
Write-Verbose filename=$filename
If( [string]::IsNullOrEmpty($filename) ) {
$vp = Get-QlikVirtualProxy -id $id -raw
$file = "$($vp.prefix)_metadata_sp.xml"
} else {
$file = $filename
}
Write-Verbose file=$file
$export = (Invoke-QlikGet "/qrs/virtualproxyconfig/$id/generate/samlmetadata").value
$basename = $file
if( $basename.IndexOf('/') -gt 0 ) {
$basename = $basename.SubString($basename.LastIndexOf('/') + 1)
}
if( $basename.IndexOf('\') -gt 0 ) {
$basename = $basename.SubString($basename.LastIndexOf('\') + 1)
}
Invoke-QlikDownload "/qrs/download/samlmetadata/$export/$basename" $file
Write-Verbose "Downloaded $id to $file"
}
}

function Get-QlikProxy {
[CmdletBinding()]
param (
Expand Down

0 comments on commit 6afc0de

Please sign in to comment.