Created
June 20, 2023 00:09
-
-
Save Nillth/ff79d4ed86ceb31890cc426ad192e66f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$QlikClient = Get-ChildItem Cert:\CurrentUser\My | Where-Object { $_.Subject -eq 'CN=QlikClient' } | |
Connect-QlikSense -TrustAllCertificates -Certificate $QlikClient -Username 'Internal\sa_api' | |
$output = [System.Collections.Generic.List[pscustomobject]]::new() | |
$QSApps = Get-QSApp | |
foreach ($App in $QSApps) | |
{ | |
$QSAppObjects = Get-QSAppObject -Filter "App.Id eq $($App.Id)" | |
$bookmarkCount = $($QSAppObjects | Where-Object { $_.ObjectType -eq 'bookmark' } | Measure-Object).Count | |
$sheetCount = $($QSAppObjects | Where-Object { $_.ObjectType -eq 'sheet' } | Measure-Object).Count | |
$storyCount = $($QSAppObjects | Where-Object { $_.ObjectType -eq 'story' } | Measure-Object).Count | |
$dimensionCount = $($QSAppObjects | Where-Object { $_.ObjectType -eq 'dimension' } | Measure-Object).Count | |
$masterobjectCount = $($QSAppObjects | Where-Object { $_.ObjectType -eq 'masterobject' } | Measure-Object).Count | |
$VariableCount = $($QSAppObjects | Where-Object { $_.ObjectType -eq 'GenericVariableEntry' } | Measure-Object).Count | |
$output.Add([pscustomobject]@{ | |
Name = $App.Name | |
Variables = $VariableCount | |
Stories = $storyCount | |
Bookmarks = $bookmarkCount | |
Sheets = $sheetCount | |
Dimensions = $dimensionCount | |
MasterObjects = $masterobjectCount | |
AppID = $App.Id | |
}) | |
} | |
$output | Format-Table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment