Difference between revisions of "Powershell"

(Data Types)
Line 95: Line 95:
 
         public bool? OveridePermissions { get; set; }
 
         public bool? OveridePermissions { get; set; }
 
   }
 
   }
 +
==RepositoryInfo==
 +
    public class RepositoryInfo
 +
    {
 +
        public string Name { get; set; }
 +
        public Version Version { get; set; }
 +
    }
 +
==RepositoryPermissions==
 +
    public class RepositoryPermission
 +
    {
 +
        public int PermissionID { get; set; }
 +
        public string MemberType { get; set; }
 +
        public int MemberID { get; set; }
 +
        public char AccessRight { get; set; }
 +
        public string Description { get; set; }
 +
        public string MemberDescription { get; set; }
 +
    }
 +
==RepositoryReport==
 +
    public class RepositoryReport
 +
    {
 +
 +
        public string Name { get; set; }
 +
        public string Path { get; set; }
 +
        public DateTime DatePublished { get; set; }
 +
        public string Description { get; set; }
 +
        public string PublishedBy { get; set; }
 +
    }
 +
==RenderedReport==
 +
public class RenderedReport
 +
    {
 +
        public string Name { get; set; }
 +
        public bool Successful { get; set; }
 +
        public byte[] Data { get; set; }
 +
        public Exception Error { get; set; }
 +
    }
  
 
=Examples=
 
=Examples=

Revision as of 14:09, 27 October 2022

Available for Version 10.0.144 and above running XLCubedWeb in a role-based SQL Repository running Windows Authentication or on an App Service.

Introduction

The PowerShell cmdlet is available by contacting support@xlcubed.com - it helps automate deployment of reports, folders and permissions.

Installing

Extract the supplied zip file, you can then install it by running the following command, either using the extracted folder as the current directory or by passing a full path:

 Import-Module '.\XLCubed.PowerShell.dll' -force

All commands take the following parameters:

-BaseUri  => The full URL to the XLCubedWeb server, for example: https://someserver/xlcubedweb
-AuthToken => Optional JWT authorisation token to use when accessing an App Service instance of XLCubedWeb

Methods

Get-XL3Connections

Return the connections used by the supplied report

Parameters

  • -Data (Dictionary<string,byte[]>)
    • Report data - can be retrieved using Select-XL3Report

Output

RepositoryConnection[]

  • The connections in the report

Set-XL3Connections

Update the connections in the report

Parameters

  • -Data (Dictionary<string,byte[]>)
    • Report data - can be retrieved using Select-XL3Report
  • Connections (RepositoryConnection[])
    • Connections to update - connections in the report will be matched by Id and updated to reflect the given Type, Server, Database and Cube

Output

Dictionary<string,byte[]>

  • The updated report data

Add-XL3Folders

Add a new folder to the repository

Parameters

  • -Path (string)
    • Path to the folder to add the new folder to
  • -Name (string)
    • Name of the folder to add

Output

RepostioryFolder

  • The folder object that has been added

Get-XL3Folders

Remove-XL3Folders

Rename-XL3Folders

Clear-XL3Permissions

Get-XL3Permissions

Remove-XL3Permissions

Set-XL3Permissions

Add-XL3Reports

Get-XL3Reports

Open-XL3Reports

Remove-XL3Reports

Rename-XL3Reports

Select-XL3Reports

Get-XL3Repository

Data Types

RepositoryConnection

public class RepositoryConnection
{
 public int Id { get; set; }
 public string Type { get; set; }
 public string Server { get; set; }
 public string Database { get; set; }
 public string Cube { get; set; }
}

RepositoryFolder

public class RepositoryFolder
 {
       public string Name { get; set; }
       public string Path { get; set; }
       public bool? OveridePermissions { get; set; }
  }

RepositoryInfo

   public class RepositoryInfo
   {
       public string Name { get; set; }
       public Version Version { get; set; }
   }

RepositoryPermissions

   public class RepositoryPermission
   {
       public int PermissionID { get; set; }
       public string MemberType { get; set; }
       public int MemberID { get; set; }
       public char AccessRight { get; set; }
       public string Description { get; set; }
       public string MemberDescription { get; set; }
   }

RepositoryReport

   public class RepositoryReport
   {
       public string Name { get; set; }
       public string Path { get; set; }
       public DateTime DatePublished { get; set; }
       public string Description { get; set; }
       public string PublishedBy { get; set; }
   }

RenderedReport

public class RenderedReport
   {
       public string Name { get; set; }
       public bool Successful { get; set; }
       public byte[] Data { get; set; }
       public Exception Error { get; set; }
   }

Examples