From f7741640e642e97a50ae4f452402556018f43333 Mon Sep 17 00:00:00 2001 From: Pete Maan Date: Thu, 8 Oct 2026 16:16:54 +0100 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=93=9A=20Add=20AccessRequest,=20CEM,?= =?UTF-8?q?=20RemoteAccess,=20RiskMgmt,=20SecretsHub,=20SecretsManager,=20?= =?UTF-8?q?SecureAI,=20UAP=20and=20UserPortal=20to=20docs=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/_config.yml | 126 ++++++++++++++++++++++++++ docs/_data/menus.yml | 180 ++++++++++++++++++++++++++++++++++++++ docs/_data/navigation.yml | 27 ++++++ 3 files changed, 333 insertions(+) diff --git a/docs/_config.yml b/docs/_config.yml index 8454244..1f957a9 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -45,6 +45,33 @@ collections: SIA: output: true permalink: /SIA/commands/:title/ + AccessRequest: + output: true + permalink: /AccessRequest/commands/:title/ + CEM: + output: true + permalink: /CEM/commands/:title/ + RemoteAccess: + output: true + permalink: /RemoteAccess/commands/:title/ + RiskMgmt: + output: true + permalink: /RiskMgmt/commands/:title/ + SecretsHub: + output: true + permalink: /SecretsHub/commands/:title/ + SecretsManager: + output: true + permalink: /SecretsManager/commands/:title/ + SecureAI: + output: true + permalink: /SecureAI/commands/:title/ + UAP: + output: true + permalink: /UAP/commands/:title/ + UserPortal: + output: true + permalink: /UserPortal/commands/:title/ defaults: - scope: @@ -81,6 +108,105 @@ defaults: render_with_liquid: false layout: command menubar: SIA + - scope: + path: AccessRequest + values: + menubar: AccessRequest + - scope: + path: "" + type: AccessRequest + values: + render_with_liquid: false + layout: command + menubar: AccessRequest + - scope: + path: CEM + values: + menubar: CEM + - scope: + path: "" + type: CEM + values: + render_with_liquid: false + layout: command + menubar: CEM + - scope: + path: RemoteAccess + values: + menubar: RemoteAccess + - scope: + path: "" + type: RemoteAccess + values: + render_with_liquid: false + layout: command + menubar: RemoteAccess + - scope: + path: RiskMgmt + values: + menubar: RiskMgmt + - scope: + path: "" + type: RiskMgmt + values: + render_with_liquid: false + layout: command + menubar: RiskMgmt + - scope: + path: SecretsHub + values: + menubar: SecretsHub + - scope: + path: "" + type: SecretsHub + values: + render_with_liquid: false + layout: command + menubar: SecretsHub + - scope: + path: SecretsManager + values: + menubar: SecretsManager + - scope: + path: "" + type: SecretsManager + values: + render_with_liquid: false + layout: command + menubar: SecretsManager + - scope: + path: SecureAI + values: + menubar: SecureAI + - scope: + path: "" + type: SecureAI + values: + render_with_liquid: false + layout: command + menubar: SecureAI + - scope: + path: UAP + values: + menubar: UAP + - scope: + path: "" + type: UAP + values: + render_with_liquid: false + layout: command + menubar: UAP + - scope: + path: UserPortal + values: + menubar: UserPortal + - scope: + path: "" + type: UserPortal + values: + render_with_liquid: false + layout: command + menubar: UserPortal exclude: - _tools diff --git a/docs/_data/menus.yml b/docs/_data/menus.yml index 9c5e2c6..d1aca9a 100644 --- a/docs/_data/menus.yml +++ b/docs/_data/menus.yml @@ -76,3 +76,183 @@ SIA: link: /SIA/getting-started/ - name: Commands link: /SIA/commands/ + +AccessRequest: + label: IdentityCommand.AccessRequest + repo: pspete/IdentityCommand.AccessRequest + commands: AccessRequest + prefix: AR + pinned: + - Connect-ARTenant + description: >- + Access Requests: raise, approve and reject requests for access. + image: /AccessRequest/media/images/IdentityCommand.AccessRequest.png + menu: + - label: IdentityCommand.AccessRequest + items: + - name: Overview + link: /AccessRequest/ + - name: Getting Started + link: /AccessRequest/getting-started/ + - name: Commands + link: /AccessRequest/commands/ + +CEM: + label: IdentityCommand.CEM + repo: pspete/IdentityCommand.CEM + commands: CEM + prefix: CEM + pinned: + - Connect-CEMTenant + description: >- + Cloud Visibility: delegate cloud workspaces through the Workspace Delegation API. + image: /CEM/media/images/IdentityCommand.CEM.png + menu: + - label: IdentityCommand.CEM + items: + - name: Overview + link: /CEM/ + - name: Getting Started + link: /CEM/getting-started/ + - name: Commands + link: /CEM/commands/ + +RemoteAccess: + label: IdentityCommand.RemoteAccess + repo: pspete/IdentityCommand.RemoteAccess + commands: RemoteAccess + prefix: RA + pinned: + - Connect-RATenant + description: >- + Remote Access: vendors, users, Vendor Manager teams, groups, self-service requests, invitations, sites, applications and activities. + image: /RemoteAccess/media/images/IdentityCommand.RemoteAccess.png + menu: + - label: IdentityCommand.RemoteAccess + items: + - name: Overview + link: /RemoteAccess/ + - name: Getting Started + link: /RemoteAccess/getting-started/ + - name: Commands + link: /RemoteAccess/commands/ + +RiskMgmt: + label: IdentityCommand.RiskMgmt + repo: pspete/IdentityCommand.RiskMgmt + commands: RiskMgmt + prefix: RM + pinned: + - Connect-RMTenant + description: >- + Risk Management: risks, findings, recommendations, remediations and risk posture. + image: /RiskMgmt/media/images/IdentityCommand.RiskMgmt.png + menu: + - label: IdentityCommand.RiskMgmt + items: + - name: Overview + link: /RiskMgmt/ + - name: Getting Started + link: /RiskMgmt/getting-started/ + - name: Commands + link: /RiskMgmt/commands/ + +SecretsHub: + label: IdentityCommand.SecretsHub + repo: pspete/IdentityCommand.SecretsHub + commands: SecretsHub + prefix: SH + pinned: + - Connect-SHTenant + description: >- + Secrets Hub: secret stores, secrets, sync policies, scans, configuration and transformations. + image: /SecretsHub/media/images/IdentityCommand.SecretsHub.png + menu: + - label: IdentityCommand.SecretsHub + items: + - name: Overview + link: /SecretsHub/ + - name: Getting Started + link: /SecretsHub/getting-started/ + - name: Commands + link: /SecretsHub/commands/ + +SecretsManager: + label: IdentityCommand.SecretsManager + repo: pspete/IdentityCommand.SecretsManager + commands: SecretsManager + prefix: SM + pinned: + - Connect-SMTenant + description: >- + Secrets Manager and Secure Workload Access: groups, workloads, issuers, authenticators, secrets, trust domains and signing keys. + image: /SecretsManager/media/images/IdentityCommand.SecretsManager.png + menu: + - label: IdentityCommand.SecretsManager + items: + - name: Overview + link: /SecretsManager/ + - name: Getting Started + link: /SecretsManager/getting-started/ + - name: Commands + link: /SecretsManager/commands/ + +SecureAI: + label: IdentityCommand.SecureAI + repo: pspete/IdentityCommand.SecureAI + commands: SecureAI + prefix: SAI + pinned: + - Connect-SAITenant + description: >- + Secure AI: AI agents, MCP servers and their access policies. + image: /SecureAI/media/images/IdentityCommand.SecureAI.png + menu: + - label: IdentityCommand.SecureAI + items: + - name: Overview + link: /SecureAI/ + - name: Getting Started + link: /SecureAI/getting-started/ + - name: Commands + link: /SecureAI/commands/ + +UAP: + label: IdentityCommand.UAP + repo: pspete/IdentityCommand.UAP + commands: UAP + prefix: UAP + pinned: + - Connect-UAPTenant + description: >- + Access Control Policies: build, change, validate and remove access policies. + image: /UAP/media/images/IdentityCommand.UAP.png + menu: + - label: IdentityCommand.UAP + items: + - name: Overview + link: /UAP/ + - name: Getting Started + link: /UAP/getting-started/ + - name: Commands + link: /UAP/commands/ + +UserPortal: + label: IdentityCommand.UserPortal + repo: pspete/IdentityCommand.UserPortal + commands: UserPortal + prefix: UP + pinned: + - Connect-UPTenant + description: >- + Access: the user portal view of assets and their secrets. + image: /UserPortal/media/images/IdentityCommand.UserPortal.png + menu: + - label: IdentityCommand.UserPortal + items: + - name: Overview + link: /UserPortal/ + - name: Getting Started + link: /UserPortal/getting-started/ + - name: Commands + link: /UserPortal/commands/ diff --git a/docs/_data/navigation.yml b/docs/_data/navigation.yml index eed3d13..1b7ee63 100644 --- a/docs/_data/navigation.yml +++ b/docs/_data/navigation.yml @@ -9,3 +9,30 @@ - name: SIA link: /SIA/ module: SIA +- name: AccessRequest + link: /AccessRequest/ + module: AccessRequest +- name: CEM + link: /CEM/ + module: CEM +- name: RemoteAccess + link: /RemoteAccess/ + module: RemoteAccess +- name: RiskMgmt + link: /RiskMgmt/ + module: RiskMgmt +- name: SecretsHub + link: /SecretsHub/ + module: SecretsHub +- name: SecretsManager + link: /SecretsManager/ + module: SecretsManager +- name: SecureAI + link: /SecureAI/ + module: SecureAI +- name: UAP + link: /UAP/ + module: UAP +- name: UserPortal + link: /UserPortal/ + module: UserPortal From 3379f093d5ced93c57aa53c0b40eab7ec06482f3 Mon Sep 17 00:00:00 2001 From: Pete Maan Date: Thu, 8 Oct 2026 16:16:54 +0100 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=93=9D=20Publish=20module=20release?= =?UTF-8?q?=20notes=20on=20docs=20site?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 4 + docs/_layouts/releases.html | 17 ++ docs/_plugins/releases.rb | 68 ++++++ docs/_tools/sync_modules.rb | 13 +- docs/assets/css/app.scss | 10 + .../2023-08-21-identitycommand-release-0-1.md | 74 +++++++ .../2024-02-13-identitycommand-release-0-2.md | 94 +++++++++ .../2025-03-09-identitycommand-release-0-3.md | 15 ++ .../2026-07-19-identitycommand-release-0-4.md | 100 +++++++++ .../2026-08-25-identitycommand-release-0-5.md | 193 ++++++++++++++++++ .../2026-09-07-identitycommand-release-0-6.md | 28 +++ .../2026-10-07-identitycommand-release-0-7.md | 51 +++++ 12 files changed, 664 insertions(+), 3 deletions(-) create mode 100644 docs/_layouts/releases.html create mode 100644 docs/_plugins/releases.rb create mode 100644 docs/collections/_posts/2023-08-21-identitycommand-release-0-1.md create mode 100644 docs/collections/_posts/2024-02-13-identitycommand-release-0-2.md create mode 100644 docs/collections/_posts/2025-03-09-identitycommand-release-0-3.md create mode 100644 docs/collections/_posts/2026-07-19-identitycommand-release-0-4.md create mode 100644 docs/collections/_posts/2026-08-25-identitycommand-release-0-5.md create mode 100644 docs/collections/_posts/2026-09-07-identitycommand-release-0-6.md create mode 100644 docs/collections/_posts/2026-10-07-identitycommand-release-0-7.md diff --git a/docs/README.md b/docs/README.md index 1f6ee75..22d5478 100644 --- a/docs/README.md +++ b/docs/README.md @@ -7,6 +7,8 @@ Jekyll site (bulma-clean-theme) for IdentityCommand and its sibling `IdentityCom | `/` | IdentityCommand pages; command help in `collections/_commands` | | `//` | Sibling module pages, copied from the sibling repo's `docs/` | | `//commands/` | Sibling command help, copied from the sibling repo's `docs/collections/_commands` | +| `/releases/` | IdentityCommand release notes in `collections/_posts` | +| `//releases/` | Sibling release notes, copied from the sibling repo's `docs/collections/_posts` into `collections/_posts//` | | `/search/` | Pagefind search, indexed after the Jekyll build | Sibling content is copied in by `_tools/sync_modules.rb`; copied folders are git-ignored. @@ -48,6 +50,7 @@ A sibling repo's `docs/` holds: - `index.md` - module landing page - `getting-started.md` - install and authentication - `collections/_commands/*.md` - platyPS command help, one file per command +- `collections/_posts/YYYY-MM-DD-.md` - release notes, one file per release, with `title`, `date` and optional `version` front matter - `media/` - images, referenced as `//media/...` Pages need no layout or menubar front matter; defaults are applied by path. @@ -65,6 +68,7 @@ For module `IdentityCommand.XYZ`: 4. Add `docs/` and the dispatch workflow to the sibling repo. The command index page at `/XYZ/commands/` is generated by `_plugins/commands.rb`. +Once the module has release notes, `_plugins/releases.rb` generates `/XYZ/releases/` and adds a Release Notes menu item. ## Workflow diff --git a/docs/_layouts/releases.html b/docs/_layouts/releases.html new file mode 100644 index 0000000..7725dd7 --- /dev/null +++ b/docs/_layouts/releases.html @@ -0,0 +1,17 @@ +--- +layout: default +--- +{% assign releases = site.posts | where: "menubar", page.menubar %} +
+ +

{{ page.title }}

+ {{ content }} +
    + {% for post in releases %} +
  • + {{ post.title }} + {{ post.subtitle }} +
  • + {% endfor %} +
+
diff --git a/docs/_plugins/releases.rb b/docs/_plugins/releases.rb new file mode 100644 index 0000000..2ad20cd --- /dev/null +++ b/docs/_plugins/releases.rb @@ -0,0 +1,68 @@ +# Release notes. +# +# Posts in collections/_posts belong to the module whose repo is `repository` in +# _config.yml; posts in collections/_posts// (copied by +# _tools/sync_modules.rb) belong to that sibling module. Each post is published +# at //releases/:slug/ (or /releases/:slug/ for this repo's module) with +# its date and version as subtitle. A module with posts gets a release notes +# index page at //releases/ and a "Release Notes" sidebar menu item. +module IdentityCommandDocs + module Releases + def self.module_key(site, post) + parts = post.relative_path.split("/") + folder = parts[(parts.index("_posts") + 1)...-1].first + folder || site.data["menus"].find { |_, m| m["repo"] == site.config["repository"] }&.first + end + + def self.base(site, key) + site.data["menus"][key]["menu"][0]["items"][0]["link"].chomp("/") + end + + def self.subtitle(post) + date = post.date.strftime("%-d %B %Y") + post.data["version"] ? "Version #{post.data['version']} - #{date}" : date + end + + def self.add_menu_item(site, key) + menu = site.data["menus"][key] + first, *rest = menu["menu"] + item = { "name" => "Release Notes", "link" => "#{base(site, key)}/releases/" } + site.data["menus"][key] = menu.merge("menu" => [first.merge("items" => first["items"] + [item]), *rest]) + end + end + + Jekyll::Hooks.register :site, :post_read, priority: :low do |site| + keys = site.posts.docs.filter_map do |post| + key = Releases.module_key(site, post) + next unless site.data["menus"][key] + + post.data["menubar"] = key + post.data["layout"] = "page" + post.data["subtitle"] ||= Releases.subtitle(post) + post.data["permalink"] = "#{Releases.base(site, key)}/releases/:slug/" + key + end + keys.uniq.each { |key| Releases.add_menu_item(site, key) } + end + + class ReleaseIndexGenerator < Jekyll::Generator + safe true + priority :low + + def generate(site) + site.posts.docs.map { |post| post.data["menubar"] }.uniq.each do |key| + menu = site.data["menus"][key] + next unless menu + + page = Jekyll::PageWithoutAFile.new(site, site.source, "#{Releases.base(site, key)}/releases/", "index.html") + page.data.merge!( + "layout" => "releases", + "title" => "#{menu['label'] || key} Release Notes", + "menubar" => key, + "hide_hero" => true + ) + site.pages << page + end + end + end +end diff --git a/docs/_tools/sync_modules.rb b/docs/_tools/sync_modules.rb index 266b098..5d2ab9f 100644 --- a/docs/_tools/sync_modules.rb +++ b/docs/_tools/sync_modules.rb @@ -4,6 +4,7 @@ # `repository` in _config.yml. For a module keyed SCA with commands collection SCA: # # /docs/collections/_commands/* -> docs/collections/_SCA/ +# /docs/collections/_posts/* -> docs/collections/_posts/SCA/ # /docs/* (everything else) -> docs/SCA/ # # Copied folders are replaced on every run and git-ignored. @@ -66,13 +67,18 @@ def copy_docs(name, collection, docs) replace_dir(commands_dest) FileUtils.cp(Dir.glob(File.join(docs, "collections", "_commands", "*.md")), commands_dest) + posts_dest = File.join(SITE_ROOT, "collections", "_posts", name) + replace_dir(posts_dest) + FileUtils.cp(Dir.glob(File.join(docs, "collections", "_posts", "*.md")), posts_dest) + # A UTF-8 BOM hides front matter from Jekyll - Dir.glob(File.join("{#{pages_dest},#{commands_dest}}", "**", "*.md")).each do |md| + Dir.glob(File.join("{#{pages_dest},#{commands_dest},#{posts_dest}}", "**", "*.md")).each do |md| text = File.binread(md) File.binwrite(md, text.byteslice(3..)) if text.start_with?("\xEF\xBB\xBF".b) end - puts "#{name}: #{Dir.glob(File.join(commands_dest, '*.md')).size} commands from #{docs}" + puts "#{name}: #{Dir.glob(File.join(commands_dest, '*.md')).size} commands, " \ + "#{Dir.glob(File.join(posts_dest, '*.md')).size} release notes from #{docs}" end # Longest noun prefix shared by every command that ends on a word boundary, e.g. SCA @@ -108,7 +114,8 @@ def preview_module(name, repo, docs) if File.exist?(PREVIEW_CONFIG) YAML.safe_load_file(PREVIEW_CONFIG).fetch("preview_modules", {}).each_key do |name| - FileUtils.rm_rf([File.join(SITE_ROOT, name), File.join(SITE_ROOT, "collections", "_#{name}")]) + FileUtils.rm_rf([File.join(SITE_ROOT, name), File.join(SITE_ROOT, "collections", "_#{name}"), + File.join(SITE_ROOT, "collections", "_posts", name)]) end FileUtils.rm_f(PREVIEW_CONFIG) end diff --git a/docs/assets/css/app.scss b/docs/assets/css/app.scss index 013b95e..0b1dc1a 100644 --- a/docs/assets/css/app.scss +++ b/docs/assets/css/app.scss @@ -69,3 +69,13 @@ $link: #c62f1a; .module-description { color: var(--bulma-text-weak); } + +.release-list { + list-style: none; + margin-left: 0; +} + +.release-list .module-description { + display: block; + font-size: 0.85rem; +} diff --git a/docs/collections/_posts/2023-08-21-identitycommand-release-0-1.md b/docs/collections/_posts/2023-08-21-identitycommand-release-0-1.md new file mode 100644 index 0000000..8759fd8 --- /dev/null +++ b/docs/collections/_posts/2023-08-21-identitycommand-release-0-1.md @@ -0,0 +1,74 @@ +--- +title: "IdentityCommand Release 0.1" +date: 2023-10-08 00:00:00 +version: 0.1.43 +tags: + - Release Notes + - New-IDSession + - Close-IDSession + - Clear-IDUserSession + - Get-IDSession + - Get-IDUser + - Suspend-IDUserMFA + - Test-IDUserCloudLock + - Lock-IDUser + - Unlock-IDUser + - Get-IDTenant + - Get-IDTenantConfiguration + - Get-IDConnector + - New-IDPlatformToken + - Get-IDUserRole + - Get-IDTenantCname + - Get-IDDownloadUrl + - Get-IDUserIdentifier + - Invoke-IDSqlcmd +--- + +## [0.1.43] + +### Changed + +- `New-IDSession` - Moves ScriptMethod declaration into code body from `\xml\IdCmd.ID.Session.Types.ps1xml`. + +### Fixed + +- Replaces `[Environment]::GetEnvironmentVariable(`Temp`)` with `[System.IO.Path]::GetTempPath()` to correctly determine %TEMP% directory location on Windows as well as OSX. + +## [0.1.39] + +### Changed + +- `New-IDSession` - Adds federated authentication support, with ability to provide a SamlResponse from an external IDP + +## [0.1.34] + +Additional Functions + +### Added + +- `Get-IDUserRole` - Get a list of roles for a user +- `Get-IDAnalyticsDataset` - Get all datasets accessible by a user +- `Get-IDTenantCname` - Get Tenant Cnames +- `Get-IDDownloadUrl` - Get download Urls +- `Get-IDUserIdentifier` - Get the configuration of the user attributes +- `Invoke-IDSqlcmd` - Query the database tables + +## [0.1.29] + +Initial module development prior to main release + +### Added + +- `New-IDSession` - Authenticate to CyberArk Identity, answering MFA challenges to start a new API session. +- `Close-IDSession` - Logoff CyberArk Identity API +- `Clear-IDUserSession` - Signs out user from all active sessions +- `Get-IDSession` - Get WebSession object from the module scope +- `Get-IDUser` - Fetch details of cloud directory users +- `Suspend-IDUserMFA` - Exempt a user from MFA +- `Test-IDUserCloudLock` - Checks if a user is cloud locked +- `Lock-IDUser` - Enable user cloud lock +- `Unlock-IDUser` - Disable user cloud locked +- `Get-IDTenant` - Get Tenant information +- `Get-IDTenantConfiguration` - Get tenant configuration data +- `Get-IDConnector` - Get connector health +- `New-IDPlatformToken` - Request OIDC token based on grant type diff --git a/docs/collections/_posts/2024-02-13-identitycommand-release-0-2.md b/docs/collections/_posts/2024-02-13-identitycommand-release-0-2.md new file mode 100644 index 0000000..7e8a15f --- /dev/null +++ b/docs/collections/_posts/2024-02-13-identitycommand-release-0-2.md @@ -0,0 +1,94 @@ +--- +title: "IdentityCommand Release 0.2" +date: 2024-03-03 00:00:00 +version: 0.2.58 +tags: + - Release Notes + - Get-IDSession + - New-IDSession + - Close-IDSession + - New-IDPlatformToken +--- + +## [0.2.58] + +### Added + +- `Find-SharedServicesURL` + - New helper function that can be used to find URLs for ISPSS services under a tenant + +### Changed + +- `ConvertTo-QueryString` + - Updates helper function to implement functionality required in `Get-DPAStrongAccount` function of the `IdentityCommand.DPA` module. + - If multiple values are accepted and provided for a value, return all values joined, delimited by a comma. + +## [0.2.55] + +### Fixed + +- `Invoke-IDRestMethod` + - Fixes a variable declaration which prevented certain error conditions from being reported. + - Updated to report more errors recieved in various formats from Identity and also DPA. + +## [0.2.49] + +### Changed + +- `New-IDSession` + - Adds `Authorization` header with Bearer token to WebSession object. +- `New-IDPlatformToken` + - Adds `Authorization` header with Bearer token to WebSession object. + - Updates values in script scope object in-line with the previous module update. +- Internal Functions & Error Handling + - Adds additional logic to handle error messages from Identity and other ISPSS services. + - Adds `LastError` details to script scope variable object returned with `Get-IDSession`. + - Makes contentType matching less stringent to accommodate data returned from other ISPSS services. + +### Fixed + +- `New-IDPlatformToken` + - Updated `GetWebSession` method to utilise `Get-IDSession` in order to return the WebSession object from the module`s script scope. + +## [0.2.46] + +Updates the `Get-IDSession` command, which can be used to return data from the module scope: + +```powershell +PS C:\> Get-IDSession + +Name Value +---- ----- +tenant_url https://abc1234.id.cyberark.cloud +User some.user@somedomain.com +TenantId ABC1234 +SessionId 1337CbGbPunk3Sm1ff5ess510nD3tai75 +WebSession Microsoft.PowerShell.Commands.WebRequestSession +StartTime 12/02/2024 22:58:13 +ElapsedTime 00:25:30 +LastCommand System.Management.Automation.InvocationInfo +LastCommandTime 12/02/2024 23:23:07 +LastCommandResults {"success":true,"Result":{"SomeResult"}} +``` + +Executing this command exports variables like the URL, Username & WebSession object for the authenticated session from IdentityCommand into your local scope, either for use in other requests outside of the module scope, or for informational purposes. + +Return data also includes details such as session start time, elapsed time, last command time, as well as data for the last invoked command and the results of the previous command useful for debugging & development purposes. + +### Added + +- Private Function `Get-ParentFunction` + - Helper function to get command invocation data from different scopes +- Private Function `Get-SessionClone` + - Helper function to create unreferenced copy of IdentityCommand session hashtable object + +### Changed + +- `Get-IDSession` + - Returns the module scoped `$ISPSSSession` variable (which includes the WebSession object), instead of just the WebSession object. +- `New-IDSession` + - Sets values in the script scope `$ISPSSSession` object instead of individual script scope variables. +- `Close-IDSession` + - Sets null values in the script scope `$ISPSSSession` object instead of removing individual script scope variables. +- All other functions + - Updated entire codebase to reference `$ISPSSSession` object instead of individual script scope variables. diff --git a/docs/collections/_posts/2025-03-09-identitycommand-release-0-3.md b/docs/collections/_posts/2025-03-09-identitycommand-release-0-3.md new file mode 100644 index 0000000..bbf5779 --- /dev/null +++ b/docs/collections/_posts/2025-03-09-identitycommand-release-0-3.md @@ -0,0 +1,15 @@ +--- +title: "IdentityCommand Release 0.3" +date: 2025-03-09 00:00:00 +version: 0.3.61 +tags: + - Release Notes +--- + +## [0.3.61] + +### Added + +- `New-IDSession: Adds support for Out-of-band IDP Authentication` + - Federated identity users from an external IDP can now authenticate. + - Thanks & Credit to Tim Schindler ([aaearon](https://github.com/aaearon)) for this! diff --git a/docs/collections/_posts/2026-07-19-identitycommand-release-0-4.md b/docs/collections/_posts/2026-07-19-identitycommand-release-0-4.md new file mode 100644 index 0000000..21693ec --- /dev/null +++ b/docs/collections/_posts/2026-07-19-identitycommand-release-0-4.md @@ -0,0 +1,100 @@ +--- +title: "IdentityCommand Release 0.4" +date: 2026-07-19 00:00:00 +version: 0.4.86 +tags: + - Release Notes + - Get-IDPermission + - Get-IDRole + - New-IDRole + - Add-IDRoleMember + - Remove-IDRoleMember + - Add-IDRolePermission + - Remove-IDRolePermission + - Remove-IDRole + - Get-IDRolePermission + - Get-IDRoleMember + - Set-IDDynamicRoleScript + - Test-IDDynamicRoleScript + - Get-IDRoleApplication + - Get-IDDynamicRoleMember + - Get-IDRoleWebApp + - Get-IDAuthenticationProfile + - Remove-IDAuthenticationProfile + - Get-IDAuthenticationAssuranceLevel + - New-IDAuthenticationProfile + - Set-IDAuthenticationProfile + - Get-IDAuthenticationPolicyModifier + - Get-IDAuthenticationPolicyLink + - Get-IDAuthenticationPolicyBlock + - Get-IDAuthenticationPolicyCloudMobileGP + - Remove-IDAuthenticationPolicyBlock + - Get-IDUserOathOTPClientName + - Get-IDUserPasswordComplexityRequirement + - New-IDAuthenticationPolicy + - New-IDTenantCname + - Remove-IDTenantCname + - Get-IDTenantURL + - Set-IDTenantPreferredCname + - Get-IDTenantSuffix + - New-IDTenantSuffix + - Remove-IDTenantSuffix + - Get-IDTenantCdsSuffix + - Set-IDAuthenticationPolicy + - New-IDSession +--- + +## [0.4.86] + +### Added + +- All credit to [Alexander Sageng](https://github.com/Slasky86) for this hefty contribution!! + - `Get-IDPermission` + - `Get-IDRole` + - `New-IDRole` + - `Update-IDRole` + - `Add-IDRoleMember` + - `Remove-IDRoleMember` + - `Add-IDRolePermission` + - `Remove-IDRolePermission` + - `Remove-IDRole` + - `Get-IDRolePermission` + - `Get-IDRoleMember` + - `Set-IDDynamicRoleScript` + - `Test-IDDynamicRoleScript` + - `Get-IDRoleApplication` + - `Get-IDDynamicRoleMember` + - `Get-IDPagedRoleMember` + - `Get-IDRoleWebApp` + - `Get-IDAuthenticationProfile` + - `Remove-IDAuthenticationProfile` + - `Get-IDAuthenticationAssuranceLevel` + - `New-IDAuthenticationProfile` + - `Set-IDAuthenticationProfile` + - `Get-IDAuthenticationPolicyModifier` + - `Get-IDAuthenticationPolicyLink` + - `Get-IDAuthenticationPolicyBlock` + - `Get-IDAuthenticationPolicyMetadata` + - `Get-IDAuthenticationPolicyCloudMobileGP` + - `Remove-IDAuthenticationPolicyBlock` + - `Get-IDUserOathOTPClientName` + - `Get-IDUserPasswordComplexityRequirement` + - `New-IDAuthenticationPolicy` + - `New-IDTenantCname` + - `Remove-IDTenantCname` + - `Get-IDTenantURL` + - `Set-IDTenantPreferredCname` + - `Get-IDTenantSuffix` + - `New-IDTenantSuffix` + - `Remove-IDTenantSuffix` + - `Get-IDTenantCdsSuffix` + - `New-IDAuthenticationPolicy` + - `Set-IDAuthenticationPolicy` + +### Fixed + +- `New-IDSession`: Adds support for OOB IdP Authentication flows that require a PIN code. + - Tenants configured to display a PIN in the browser after external IdP login are now prompted for the PIN and completed via `AdvanceAuthentication`. Previously these tenants would hang in the `OobAuthStatus` polling loop with no way to enter the PIN. + - Credit to Tim Schindler ([aaearon](https://github.com/aaearon)) +- SMS 2FA: Resolve issue where using SMS 2FA resulted in script asking for 2FA code before 2FA code was sent to phone + - Thanks [SkylerWallace](https://github.com/SkylerWallace)!! diff --git a/docs/collections/_posts/2026-08-25-identitycommand-release-0-5.md b/docs/collections/_posts/2026-08-25-identitycommand-release-0-5.md new file mode 100644 index 0000000..d2d088a --- /dev/null +++ b/docs/collections/_posts/2026-08-25-identitycommand-release-0-5.md @@ -0,0 +1,193 @@ +--- +title: "IdentityCommand Release 0.5" +date: 2026-08-25 00:00:00 +version: 0.5.147 +tags: + - Release Notes + - Get-IDApplication + - New-IDApplication + - Set-IDApplication + - Remove-IDApplication + - Copy-IDApplication + - Get-IDApplicationData + - Get-IDApplicationForUser + - Get-IDApplicationTemplate + - Import-IDApplicationTemplate + - Get-IDApplicationPermission + - Set-IDApplicationPermission + - Get-IDApplicationTag + - New-IDApplicationTag + - Set-IDApplicationTag + - Rename-IDApplicationTag + - Remove-IDApplicationTag + - Set-IDApplicationIcon + - Set-IDApplicationUserCredential + - Get-IDSecuredItem + - New-IDSecuredItem + - Set-IDSecuredItemIcon + - Set-IDSecuredItemTag + - Update-IDSecuredItemCredential + - Get-IDPersonalApplicationImportFile + - Get-IDPersonalApplicationImportLog + - Import-IDPersonalApplicationCsv + - Get-IDUserPortalData + - Get-IDCredentialProvider + - Move-IDUserOwnership + - Test-IDApplicationCatalogAvailability + - Test-IDApplicationUsername + - Update-IDCapturedUserApplication + - Update-IDPersonalUserApplication + - Update-IDUserApplication + - Get-IDOrganization + - New-IDOrganization + - Set-IDOrganization + - Remove-IDOrganization + - Get-IDOrganizationAdministrator + - Set-IDOrganizationAdministrator + - Get-IDOrganizationMember + - Get-IDOrganizationPermission + - Get-IDOrganizationRole + - Set-IDOrganizationMembership + - Remove-IDSCIMUser + - Remove-IDSCIMGroup + - Remove-IDSCIMContainer + - Remove-IDSCIMContainerPermission + - Remove-IDSCIMPrivilegedData + - Get-IDSCIMResourceType + - Get-IDSCIMSchema + - Get-IDSCIMServiceProviderConfig + - New-IDUser + - Set-IDUser + - Remove-IDUser + - Enable-IDUser + - Disable-IDUser + - Import-IDUserCsv + - Set-IDUserPassword + - Set-IDUserPhonePin + - Set-IDUserPicture + - Get-IDUserAttribute + - Set-IDUserAttribute + - Get-IDUserHierarchy + - Get-IDUserInfo + - Get-IDUserRiskLevel + - Get-IDUserSecurityQuestion + - Set-IDUserSecurityQuestion + - Reset-IDUserSecurityQuestion + - Get-IDUserU2FDevice + - Get-IDUserU2FRegistrationChallenge + - Complete-IDUserU2FRegistrationChallenge + - Remove-IDUserU2FDevice + - Close-IDUserSession + - Send-IDUserIdentityVerification + - Send-IDUserInvite + - Send-IDUserLoginEmail + - Sync-IDUserOathToken + - Test-IDUserLockedOutByPolicy + - Get-IDWorkflowJob + - Get-IDWorkflowJobReport + - Start-IDWorkflowJob + - Remove-IDWorkflowJob + - Send-IDWorkflowEvent + - New-IDDevice + - Remove-IDDevice + - Unregister-IDDevice + - Get-IDTenantConfigEntry + - Set-IDTenantConfigEntry + - Remove-IDTenantConfigEntry + - Set-IDTenantConfiguration + - Get-IDTenantMessageTemplate + - Get-IDTenantSecurityQuestion + - Set-IDTenantSecurityQuestion + - Remove-IDTenantSecurityQuestion + - New-IDPassword + - New-IDSession + - Invoke-IDSqlcmd + - Get-IDRoleWebApp + - Set-IDRole + - New-IDTenantSuffix + - Get-IDAuthenticationPolicyBlock + - Get-IDAuthenticationPolicyLink + - Get-IDConnector + - Get-IDTenant + - Get-IDUserRole +--- + +## [0.5.147] + +Major expansion of Identity Administration API coverage - 113 new commands across +Applications, Organizations, SCIM, Users, Workflow, Devices and Tenant. + +### Added + +- Applications + - `Get-IDApplication`, `New-IDApplication`, `Set-IDApplication`, `Remove-IDApplication`, `Copy-IDApplication` + - `Get-IDApplicationData`, `Get-IDApplicationForUser`, `Get-IDApplicationTemplate`, `Import-IDApplicationTemplate` + - `Get-IDApplicationPermission`, `Set-IDApplicationPermission` + - `Get-IDApplicationTag`, `New-IDApplicationTag`, `Set-IDApplicationTag`, `Rename-IDApplicationTag`, `Remove-IDApplicationTag` + - `Set-IDApplicationIcon`, `Set-IDApplicationUserCredential` + - `Get-IDSecuredItem`, `New-IDSecuredItem`, `Set-IDSecuredItemIcon`, `Set-IDSecuredItemTag`, `Update-IDSecuredItemCredential` + - `Get-IDPersonalApplicationImportFile`, `Get-IDPersonalApplicationImportLog`, `Import-IDPersonalApplicationCsv` + - `Get-IDUserPortalData`, `Get-IDCredentialProvider`, `Move-IDUserOwnership` + - `Test-IDApplicationCatalogAvailability`, `Test-IDApplicationUsername` + - `Update-IDCapturedUserApplication`, `Update-IDPersonalUserApplication`, `Update-IDUserApplication` +- Organizations + - `Get-IDOrganization`, `New-IDOrganization`, `Set-IDOrganization`, `Remove-IDOrganization` + - `Get-IDOrganizationAdministrator`, `Set-IDOrganizationAdministrator` + - `Get-IDOrganizationMember`, `Get-IDOrganizationPermission`, `Get-IDOrganizationRole`, `Set-IDOrganizationMembership` +- SCIM provisioning (Users, Groups, Containers, Container Permissions, Privileged Data) + - `Get-`/`New-`/`Set-`/`Update-`/`Remove-IDSCIMUser` + - `Get-`/`New-`/`Set-`/`Update-`/`Remove-IDSCIMGroup` + - `Get-`/`New-`/`Set-`/`Remove-IDSCIMContainer` + - `Get-`/`New-`/`Set-`/`Remove-IDSCIMContainerPermission` + - `Get-`/`New-`/`Set-`/`Remove-IDSCIMPrivilegedData` + - `Get-IDSCIMResourceType`, `Get-IDSCIMSchema`, `Get-IDSCIMServiceProviderConfig` +- Users + - `New-IDUser`, `Set-IDUser`, `Remove-IDUser`, `Enable-IDUser`, `Disable-IDUser`, `Import-IDUserCsv` + - `Set-IDUserPassword`, `Set-IDUserPhonePin`, `Set-IDUserPicture` + - `Get-IDUserAttribute`, `Set-IDUserAttribute`, `Get-IDUserHierarchy`, `Get-IDUserInfo`, `Get-IDUserRiskLevel` + - `Get-IDUserSecurityQuestion`, `Set-IDUserSecurityQuestion`, `Reset-IDUserSecurityQuestion` + - `Get-IDUserU2FDevice`, `Get-IDUserU2FRegistrationChallenge`, `Complete-IDUserU2FRegistrationChallenge`, `Remove-IDUserU2FDevice` + - `Close-IDUserSession`, `Send-IDUserIdentityVerification`, `Send-IDUserInvite`, `Send-IDUserLoginEmail` + - `Sync-IDUserOathToken`, `Test-IDUserLockedOutByPolicy` +- Workflow + - `Get-IDWorkflowJob`, `Get-IDWorkflowJobReport`, `Start-IDWorkflowJob`, `Remove-IDWorkflowJob`, `Send-IDWorkflowEvent` +- Devices + - `New-IDDevice`, `Remove-IDDevice`, `Unregister-IDDevice` +- Tenant + - `Get-IDTenantConfigEntry`, `Set-IDTenantConfigEntry`, `Remove-IDTenantConfigEntry`, `Set-IDTenantConfiguration` + - `Get-IDTenantMessageTemplate` + - `Get-IDTenantSecurityQuestion`, `Set-IDTenantSecurityQuestion`, `Remove-IDTenantSecurityQuestion` +- `New-IDPassword` - generates a password for a user + +### Changed + +- `Invoke-IDRestMethod` + - Any request body carrying a decoded password/secret is now sent as raw UTF8 bytes instead of a JSON string, so Windows PowerShell's ParameterBinding/Module Logging can no longer capture the plaintext value. Applies module-wide, including `Set-IDUserPassword`, `New-IDUser`, `New-IDSecuredItem`, `Update-IDSecuredItemCredential`, `Set-IDApplicationUserCredential`, `Set-IDUserSecurityQuestion`, `Send-IDUserIdentityVerification`, `Import-IDPersonalApplicationCsv` and the login flow (`New-IDSession`). +- `Get-IDResponse` + - Now matches any `*json*` content type instead of requiring an exact `application/json` match, fixing responses from SCIM endpoints (`application/scim+json`). +- `Invoke-IDSqlcmd` + - `-Limit` is now paired with `-PageNumber`/`-PageSize` automatically when only `-Limit` is supplied, matching how the underlying API actually honors it. +- `Get-IDRoleWebApp` + - No longer sends an unnecessary request body. +- `Set-IDRole` + - Corrects the request body shape. +- `New-IDTenantSuffix` + - Corrects the request body shape. +- `Get-IDAuthenticationPolicyBlock` + - Adds an `-ID` alias to `-Name` for direct pipeline input from `Get-IDAuthenticationPolicyLink`. +- `Hide-SecretValue` + - Adds `OldPassword` to the list of redacted field names in debug output. + +### Fixed + +- `Get-IDConnector` + - Corrects the result property read from the response. +- `Get-IDTenant` + - Corrects the output property read from the response. +- `Get-IDUserRole` + - Corrects the return property read from the response. + +### Removed + +- `Get-IDAnalyticsDataset`, `Get-IDAuthenticationPolicyMetadata`, `Get-IDPagedRoleMember` + - Little practical benefit for API administration, or found to be dead/unconfirmed endpoints. diff --git a/docs/collections/_posts/2026-09-07-identitycommand-release-0-6.md b/docs/collections/_posts/2026-09-07-identitycommand-release-0-6.md new file mode 100644 index 0000000..cc14cdc --- /dev/null +++ b/docs/collections/_posts/2026-09-07-identitycommand-release-0-6.md @@ -0,0 +1,28 @@ +--- +title: "IdentityCommand Release 0.6" +date: 2026-09-07 00:00:00 +version: 0.6.158 +tags: + - Release Notes +--- + +## [0.6.158] + +### Added + +- Shared private helper functions for IdentityCommand.SCA & IdentityCommand.SIA + +### Fixed + +- `Invoke-IDRestMethod` no longer downgrades the TLS configuration of the session. + - On PowerShell Core, `-SslProtocol TLS12` is no longer set. `WebSslProtocol` is a flags enum, so + it permitted TLS 1.2 and nothing else, excluding TLS 1.3. The connection now negotiates the + strongest protocol both ends support. + - On Windows PowerShell, a `SystemDefault` security protocol is left untouched rather than being + replaced with TLS 1.2 only. The previous guard tested `SystemDefault -match 'Tls12'`, which is + false, so a process on .NET Framework 4.7 or above - where `SystemDefault` is both the default + and the correct value - was pinned to TLS 1.2 on its first request, and a process with TLS 1.3 + enabled had it stripped. TLS 1.2 is now added only where an explicit legacy protocol is set, and + is combined with the protocols already permitted. + - Applies equally to IdentityCommand.SIA, IdentityCommand.SCA and IdentityCommand.DiscoveryMgmt, + which dot-source this module's private functions. diff --git a/docs/collections/_posts/2026-10-07-identitycommand-release-0-7.md b/docs/collections/_posts/2026-10-07-identitycommand-release-0-7.md new file mode 100644 index 0000000..b6956df --- /dev/null +++ b/docs/collections/_posts/2026-10-07-identitycommand-release-0-7.md @@ -0,0 +1,51 @@ +--- +title: "IdentityCommand Release 0.7" +date: 2026-10-07 00:00:00 +version: 0.7.159 +tags: + - Release Notes +--- + +## [0.7.159] + +### Added + +- `Find-SharedServicesURL` recognises the platform discovery keys for further shared services: + `aigw`, `alerong`, `ars`, `cds`, `compass`, `dms`, `uap` and `userportal`. +- `ConvertTo-FilterClause`: formats a single `field operator value` filter clause, quoting and + escaping the value as the ISPSS filter dialects require. Services differ in operator vocabulary, + clause joining and parenthesisation, so companion modules assemble their own expressions from + these clauses. The clause is not url encoded - `Add-QueryString` encodes the query string as a + whole. + +### Changed + +- `Resolve-ServiceUrl` now throws when the requested service is absent from the platform discovery + response, instead of returning a null `ServiceUrl`. A service which is not enabled on the tenant, + or a mistyped service key, previously left the calling `Connect-` command holding a session bound + to no URL at all. +- `Resolve-ServiceUrl` also strips a trailing slash from the resolved `ServiceUrl`. Services vary in + whether they publish a `/api` suffix, a trailing slash, both or neither, so callers can now append + their own `/` unconditionally. +- `Resolve-ServiceUrl` accepts `-BaseUrlOnly`, returning only the scheme and host of the service URL + and reporting any path separately as `ServicePath`. Needed by services which publish a path along + with the host, such as `alerong` (Remote Access). Includes a recovery for discovery responses which + omit the slash between host and path. +- `Resolve-ServiceUrl` output carries a `ServicePath` property, empty unless `-BaseUrlOnly` was used. +- `Get-PagedResult` Offset style recognises two further ways an endpoint reports the end of a set: + `-LastPageKey` for a boolean last page flag such as `isLastPage`, and `-OffsetResponseKey` for a + next offset echoed back on the response and omitted on the final page. `-OffsetResponseKey` accepts + a dotted path for a nested value, for example `paging.offset`. +- `Get-PagedResult` Offset style can page a `POST` endpoint, for those which take their paging values + in the request body: `-Method POST` with `-BodyTemplate`, and `-BodyPagingProperty` when the paging + values sit in a nested object. The body is cloned per page with only the offset replaced, so + filters and search terms carry across pages. + +### Fixed + +- `Get-PagedResult` Cursor style stops when the server returns the same continuation token it was + sent, instead of requesting that page indefinitely. Reachable against an endpoint which reports a + token unconditionally, or one which ignores the token parameter altogether. +- `Select-ChallengeMechanism` uses the full `System.Management.Automation.Host.ChoiceDescription` + type name instead of a `using namespace` statement, so it works when the module is combined into + a single file and when companion modules copy the private helpers. From 26dad64030cb6c3706a20fc15eb9897c9113f620 Mon Sep 17 00:00:00 2001 From: Pete Maan Date: Thu, 8 Oct 2026 16:29:24 +0100 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=94=97=20Add=20version=20release=20no?= =?UTF-8?q?te=20redirects=20and=20combined=20release=20notes=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/README.md | 2 + docs/_layouts/releases.html | 9 ++++- docs/_plugins/releases.rb | 80 +++++++++++++++++++++++++++++-------- 3 files changed, 74 insertions(+), 17 deletions(-) diff --git a/docs/README.md b/docs/README.md index 22d5478..00d8913 100644 --- a/docs/README.md +++ b/docs/README.md @@ -9,6 +9,8 @@ Jekyll site (bulma-clean-theme) for IdentityCommand and its sibling `IdentityCom | `//commands/` | Sibling command help, copied from the sibling repo's `docs/collections/_commands` | | `/releases/` | IdentityCommand release notes in `collections/_posts` | | `//releases/` | Sibling release notes, copied from the sibling repo's `docs/collections/_posts` into `collections/_posts//` | +| `//releases//` | Redirect to the release note with that `version` (full or major.minor) | +| `/releases/all/` | Release notes for all modules | | `/search/` | Pagefind search, indexed after the Jekyll build | Sibling content is copied in by `_tools/sync_modules.rb`; copied folders are git-ignored. diff --git a/docs/_layouts/releases.html b/docs/_layouts/releases.html index 7725dd7..adf39c6 100644 --- a/docs/_layouts/releases.html +++ b/docs/_layouts/releases.html @@ -1,11 +1,18 @@ --- layout: default --- -{% assign releases = site.posts | where: "menubar", page.menubar %} +{% if page.all %} + {% assign releases = site.posts | where_exp: "post", "site.data.menus[post.menubar]" %} +{% else %} + {% assign releases = site.posts | where: "menubar", page.menubar %} +{% endif %}

{{ page.title }}

{{ content }} + {% unless page.all %} +

Release notes for all modules

+ {% endunless %}
    {% for post in releases %}
  • diff --git a/docs/_plugins/releases.rb b/docs/_plugins/releases.rb index 2ad20cd..fb4dd01 100644 --- a/docs/_plugins/releases.rb +++ b/docs/_plugins/releases.rb @@ -4,14 +4,23 @@ # _config.yml; posts in collections/_posts// (copied by # _tools/sync_modules.rb) belong to that sibling module. Each post is published # at //releases/:slug/ (or /releases/:slug/ for this repo's module) with -# its date and version as subtitle. A module with posts gets a release notes -# index page at //releases/ and a "Release Notes" sidebar menu item. +# its date and version as subtitle. A post with a `version` is also reachable at +# //releases// and //releases//, which +# redirect to it. +# +# A module with posts gets a release notes index page at //releases/ and +# a "Release Notes" sidebar menu item. /releases/all/ lists every module's posts. module IdentityCommandDocs module Releases + ALL = "/releases/all/".freeze + + def self.root_key(site) + site.data["menus"].find { |_, m| m["repo"] == site.config["repository"] }&.first + end + def self.module_key(site, post) parts = post.relative_path.split("/") - folder = parts[(parts.index("_posts") + 1)...-1].first - folder || site.data["menus"].find { |_, m| m["repo"] == site.config["repository"] }&.first + parts[(parts.index("_posts") + 1)...-1].first || root_key(site) end def self.base(site, key) @@ -23,12 +32,41 @@ def self.subtitle(post) post.data["version"] ? "Version #{post.data['version']} - #{date}" : date end + def self.version_aliases(post) + version = post.data["version"].to_s + return [] if version.empty? + + [version.split(".").first(2).join("."), version].uniq + end + def self.add_menu_item(site, key) menu = site.data["menus"][key] first, *rest = menu["menu"] item = { "name" => "Release Notes", "link" => "#{base(site, key)}/releases/" } site.data["menus"][key] = menu.merge("menu" => [first.merge("items" => first["items"] + [item]), *rest]) end + + def self.page(site, dir, data) + Jekyll::PageWithoutAFile.new(site, site.source, dir, "index.html").tap { |p| p.data.merge!(data) } + end + + def self.redirect(site, dir, target) + url = target.url + absolute = "#{site.config['url']}#{site.baseurl}#{url}" + page(site, dir, "layout" => nil, "sitemap" => false).tap do |p| + p.content = <<~HTML + + + + #{target.data['title']} + + + + #{target.data['title']} + + HTML + end + end end Jekyll::Hooks.register :site, :post_read, priority: :low do |site| @@ -45,24 +83,34 @@ def self.add_menu_item(site, key) keys.uniq.each { |key| Releases.add_menu_item(site, key) } end - class ReleaseIndexGenerator < Jekyll::Generator + class ReleasePageGenerator < Jekyll::Generator safe true priority :low def generate(site) - site.posts.docs.map { |post| post.data["menubar"] }.uniq.each do |key| + posts = site.posts.docs.select { |post| site.data["menus"][post.data["menubar"]] } + return if posts.empty? + + taken = site.pages.map(&:url) + posts.map(&:url) + posts.group_by { |post| post.data["menubar"] }.each do |key, module_posts| menu = site.data["menus"][key] - next unless menu - - page = Jekyll::PageWithoutAFile.new(site, site.source, "#{Releases.base(site, key)}/releases/", "index.html") - page.data.merge!( - "layout" => "releases", - "title" => "#{menu['label'] || key} Release Notes", - "menubar" => key, - "hide_hero" => true - ) - site.pages << page + releases = "#{Releases.base(site, key)}/releases/" + site.pages << Releases.page(site, releases, "layout" => "releases", "title" => "#{menu['label'] || key} Release Notes", + "menubar" => key, "hide_hero" => true) + + module_posts.sort_by(&:date).reverse_each do |post| + Releases.version_aliases(post).each do |version| + dir = "#{releases}#{version}/" + next if taken.include?(dir) + + taken << dir + site.pages << Releases.redirect(site, dir, post) + end + end end + + site.pages << Releases.page(site, Releases::ALL, "layout" => "releases", "title" => "All Release Notes", + "menubar" => Releases.root_key(site), "hide_hero" => true, "all" => true) end end end From fefde876f6f324d022a0658393cc1fb86fc01604 Mon Sep 17 00:00:00 2001 From: Pete Maan Date: Thu, 8 Oct 2026 19:11:49 +0100 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=9A=80=20Rebuild=20docs=20site=20when?= =?UTF-8?q?=20a=20release=20is=20published?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/docs-dispatch.yml | 20 ++++++++++++++++++++ docs/README.md | 4 ++-- docs/_tools/docs-dispatch.yml | 12 +++++++++--- 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/docs-dispatch.yml diff --git a/.github/workflows/docs-dispatch.yml b/.github/workflows/docs-dispatch.yml new file mode 100644 index 0000000..67bd7bf --- /dev/null +++ b/.github/workflows/docs-dispatch.yml @@ -0,0 +1,20 @@ +# Runs docs.yml on main when a release is published. The version commit that +# adds the release notes carries [skip ci], so it does not start docs.yml itself. +name: Docs dispatch + +on: + release: + types: [published] + +permissions: + actions: write + +jobs: + dispatch: + if: ${{ !github.event.release.prerelease }} + runs-on: ubuntu-latest + steps: + - name: Run docs workflow on main + env: + GH_TOKEN: ${{ github.token }} + run: gh workflow run docs.yml -R "${{ github.repository }}" --ref main diff --git a/docs/README.md b/docs/README.md index 00d8913..1a5d457 100644 --- a/docs/README.md +++ b/docs/README.md @@ -58,7 +58,7 @@ A sibling repo's `docs/` holds: Pages need no layout or menubar front matter; defaults are applied by path. Links between pages use `{{ '//page/' | relative_url }}`. -Copy [_tools/docs-dispatch.yml](_tools/docs-dispatch.yml) to the sibling's `.github/workflows/` and add secret `DOCS_DISPATCH_TOKEN` (fine-grained PAT, `pspete/IdentityCommand` only, Contents: read and write) so docs changes rebuild the site. +Copy [_tools/docs-dispatch.yml](_tools/docs-dispatch.yml) to the sibling's `.github/workflows/` and add secret `DOCS_DISPATCH_TOKEN` (fine-grained PAT, `pspete/IdentityCommand` only, Contents: read and write) so docs changes and published releases rebuild the site. ## Adding a module @@ -74,6 +74,6 @@ Once the module has release notes, `_plugins/releases.rb` generates `/XYZ/releas ## Workflow -Triggers: push to `main` touching `docs/`, `repository_dispatch` type `docs-updated`, manual run. +Triggers: push to `main` touching `docs/`, `repository_dispatch` type `docs-updated` (sent by each sibling's `docs-dispatch.yml`), manual run (sent by this repo's `docs-dispatch.yml` when a release is published). Sibling branch: manual `branch` input, else repository variable `DOCS_SIBLING_BRANCH`, else `main`. Deploys only from `main`. diff --git a/docs/_tools/docs-dispatch.yml b/docs/_tools/docs-dispatch.yml index fe56468..ebd886c 100644 --- a/docs/_tools/docs-dispatch.yml +++ b/docs/_tools/docs-dispatch.yml @@ -1,8 +1,11 @@ # Copy to .github/workflows/docs-dispatch.yml in a sibling module repo. # # Rebuilds the unified docs site in pspete/IdentityCommand when this repo's -# docs/ change. Requires repository secret DOCS_DISPATCH_TOKEN: a fine-grained -# PAT with access to pspete/IdentityCommand only, permission Contents: read and write. +# docs/ change, or when a release is published. The release trigger covers the +# release notes added by the version commit, which carries [skip ci] and so +# does not start the push trigger. Requires repository secret DOCS_DISPATCH_TOKEN: +# a fine-grained PAT with access to pspete/IdentityCommand only, permission +# Contents: read and write. name: Docs dispatch on: @@ -10,12 +13,15 @@ on: branches: [main] paths: - docs/** + release: + types: [published] workflow_dispatch: permissions: {} jobs: dispatch: + if: ${{ !github.event.release.prerelease }} runs-on: ubuntu-latest steps: - name: Send docs-updated to IdentityCommand @@ -25,5 +31,5 @@ jobs: gh api repos/pspete/IdentityCommand/dispatches \ -f event_type=docs-updated \ -f "client_payload[repository]=${{ github.repository }}" \ - -f "client_payload[branch]=${{ github.ref_name }}" \ + -f "client_payload[branch]=${{ github.event_name == 'release' && github.event.release.target_commitish || github.ref_name }}" \ -f "client_payload[sha]=${{ github.sha }}" From c9d9d2f9ebbb9a23fa5d338752380da172aca55e Mon Sep 17 00:00:00 2001 From: Pete Maan Date: Thu, 8 Oct 2026 21:45:20 +0100 Subject: [PATCH 5/7] =?UTF-8?q?=F0=9F=9A=9A=20Move=20to=20pspete.Build=20G?= =?UTF-8?q?itHub=20Actions=20pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 257 ++++++++++++++++++ .gitignore | 3 +- CHANGELOG.md | 11 +- CONTRIBUTING.md | 2 +- IdentityCommand/IdentityCommand.psd1 | 2 +- IdentityCommand/IdentityCommand.psm1 | 31 ++- .../Private/ConvertTo-QueryString.ps1 | 1 - IdentityCommand/Private/Get-Parameter.ps1 | 2 - README.md | 35 ++- Tests/Add-IDRolePermission.Tests.ps1 | 4 +- Tests/ConvertTo-SecretBody.Tests.ps1 | 2 +- ...t-IDPersonalApplicationImportLog.Tests.ps1 | 4 +- Tests/Get-IDUser.Tests.ps1 | 8 +- Tests/Get-MechanismAnswer.Tests.ps1 | 2 +- Tests/IdentityCommand.Tests.ps1 | 243 ++--------------- Tests/Out-QRImage.Tests.ps1 | 2 +- Tests/Remove-IDRolePermission.Tests.ps1 | 4 +- Tests/Start-AdvanceAuthentication.Tests.ps1 | 2 +- appveyor.yml | 58 ---- build/build.ps1 | 102 ------- build/deploy-github.ps1 | 120 -------- build/deploy-psgallery.ps1 | 68 ----- build/install.ps1 | 46 ---- build/test.ps1 | 67 ----- 24 files changed, 345 insertions(+), 731 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 appveyor.yml delete mode 100644 build/build.ps1 delete mode 100644 build/deploy-github.ps1 delete mode 100644 build/deploy-psgallery.ps1 delete mode 100644 build/install.ps1 delete mode 100644 build/test.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d77bf17 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,257 @@ +# Build, test and release the IdentityCommand PowerShell module. +# +# Repository secrets (Settings > Secrets and variables > Actions), mapped into steps via env: +# CODECOV_TOKEN - Codecov upload token +# access_token - GitHub fine-grained token, Contents read/write (version commit + GitHub Release) +# git_email - commit author email for the version commit (mapped to env github_email; secret names cannot start with GITHUB_) +# psgallery_key - PowerShell Gallery API key + +name: CI + +on: + push: + branches: + - '**' + paths: + - 'IdentityCommand/**' + - 'Tests/**' + # PRs also run on CHANGELOG.md and workflow edits: the CHANGELOG decides the release version. + pull_request: + branches: + - main + - master + - vNext + paths: + - 'IdentityCommand/**' + - 'Tests/**' + - CHANGELOG.md + - '.github/workflows/ci.yml' + # Manual runs ignore path filters. + workflow_dispatch: + +# One run at a time per ref, so release version commits cannot race. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +permissions: + contents: read + +env: + MODULE_NAME: IdentityCommand + # pspete.Build tag or branch cloned into ./build by each job. + BUILD_REF: v1 + MODULE_GUID: 'f6bb2bdf-0c53-443f-be07-3c25264a09b1' + GIT_USER_NAME: 'Pete Maan' + RELEASE_VERSION_GATE: '0.1.0' + # Stable release notes are written to a post per major.minor version in this folder; empty for none. + RELEASE_NOTES_PATH: 'docs/collections/_posts' + # vNext releases are prereleases: -preview. + PRERELEASE_LABEL: ${{ github.ref == 'refs/heads/vNext' && 'preview' || '' }} + +defaults: + run: + shell: pwsh + +jobs: + test: + name: Test Source (Code Coverage) + runs-on: windows-latest + steps: + - uses: actions/checkout@v7 + - name: Get Build Scripts + run: git clone --depth 1 --branch $env:BUILD_REF https://github.com/pspete/pspete.Build build + - name: Install Dependencies + run: ./build/install.ps1 + # Help is generated locally with platyPS 0.14 and committed; PlatyPS 1.x output regresses it. + #- name: Update External Help + # run: ./build/help.ps1 -ModuleName $env:MODULE_NAME + - name: Test Source + run: ./build/test.ps1 -CodeCoverage -ModuleGuid $env:MODULE_GUID + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + - name: Upload Test Results + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v7 + with: + name: test-results-source + path: TestResults.xml + overwrite: true + + changelog: + name: CHANGELOG Entry + if: github.event_name == 'pull_request' + runs-on: windows-latest + steps: + - uses: actions/checkout@v7 + - name: Get Build Scripts + run: git clone --depth 1 --branch $env:BUILD_REF https://github.com/pspete/pspete.Build build + - name: Check Unreleased Notes + run: ./build/changelog.ps1 + + # Build and built module tests run for main/master/vNext and PRs (the pull_request trigger only includes main/master/vNext). + build: + name: Build + if: >- + github.event_name == 'pull_request' || + contains(fromJSON('["refs/heads/main", "refs/heads/master", "refs/heads/vNext"]'), github.ref) + runs-on: windows-latest + outputs: + moduleVersion: ${{ steps.version.outputs.moduleVersion }} + releaseVersion: ${{ steps.version.outputs.releaseVersion }} + steps: + - uses: actions/checkout@v7 + - name: Get Build Scripts + run: git clone --depth 1 --branch $env:BUILD_REF https://github.com/pspete/pspete.Build build + # moduleVersion is the manifest ModuleVersion (package folder name); releaseVersion adds any prerelease label. + - name: Set Module Version + id: version + run: | + $Version = ./build/version.ps1 -ModuleName $env:MODULE_NAME -PrereleaseLabel "$env:PRERELEASE_LABEL" + $ModuleVersion = ($Version -split '-')[0] + "moduleVersion=$ModuleVersion" >> $env:GITHUB_OUTPUT + "releaseVersion=$Version" >> $env:GITHUB_OUTPUT + "### $env:MODULE_NAME $Version" >> $env:GITHUB_STEP_SUMMARY + # Help is generated locally with platyPS 0.14 and committed; PlatyPS 1.x output regresses it. + #- name: Update External Help + # run: ./build/help.ps1 -ModuleName $env:MODULE_NAME + - name: Build Module + run: >- + ./build/build.ps1 + -ModuleName $env:MODULE_NAME + -BuildVersion '${{ steps.version.outputs.releaseVersion }}' + -OutputFolder "$env:RUNNER_TEMP/staging" + - name: Upload Built Module + uses: actions/upload-artifact@v7 + with: + name: module + path: ${{ runner.temp }}/staging/${{ env.MODULE_NAME }} + overwrite: true + + test-module: + name: Test Built Module (${{ matrix.name }}) + needs: build + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - name: PowerShell + os: windows-latest + shell: pwsh + - name: WindowsPowerShell + os: windows-latest + shell: powershell + - name: Linux + os: ubuntu-latest + shell: pwsh + #- name: Mac + # os: macos-latest + # shell: pwsh + defaults: + run: + shell: ${{ matrix.shell }} + steps: + - uses: actions/checkout@v7 + - name: Remove Module Source + run: Remove-Item -Path "./$env:MODULE_NAME" -Recurse -Force + - name: Get Build Scripts + run: git clone --depth 1 --branch $env:BUILD_REF https://github.com/pspete/pspete.Build build + - name: Download Built Module + uses: actions/download-artifact@v8 + with: + name: module + path: ${{ env.MODULE_NAME }} + # Windows PowerShell 5.1 has no PSResourceGet; install.ps1 skips its ~60s bootstrap when the module is found. + # The key rolls monthly so a newer PSResourceGet is picked up. + - name: Cache Month + id: month + if: matrix.shell == 'powershell' + run: '"month=$(Get-Date -Format yyyy-MM)" >> $env:GITHUB_OUTPUT' + - name: Cache PSResourceGet + if: matrix.shell == 'powershell' + uses: actions/cache@v6 + with: + path: ~/Documents/WindowsPowerShell/Modules/Microsoft.PowerShell.PSResourceGet + key: psresourceget-winps-${{ steps.month.outputs.month }} + - name: Install Dependencies + run: ./build/install.ps1 + - name: Test Built Module + run: ./build/test.ps1 -ModuleGuid $env:MODULE_GUID + - name: Upload Test Results + if: ${{ !cancelled() }} + uses: actions/upload-artifact@v7 + with: + name: test-results-${{ matrix.name }} + path: TestResults.xml + overwrite: true + + # Release runs only for pushes and manual runs on main/master (stable) and vNext (prerelease), never for PRs. + release: + name: Release + needs: + - test + - build + - test-module + if: >- + github.event_name != 'pull_request' && + contains(fromJSON('["refs/heads/main", "refs/heads/master", "refs/heads/vNext"]'), github.ref) + runs-on: windows-latest + env: + MODULE_VERSION: ${{ needs.build.outputs.moduleVersion }} + RELEASE_VERSION: ${{ needs.build.outputs.releaseVersion }} + steps: + # deploy-github.ps1 pushes with access_token; the checkout token must not override it. + - uses: actions/checkout@v7 + with: + persist-credentials: false + - name: Get Build Scripts + run: git clone --depth 1 --branch $env:BUILD_REF https://github.com/pspete/pspete.Build build + - name: Download Built Module + uses: actions/download-artifact@v8 + with: + name: module + path: ${{ runner.temp }}/Package/${{ env.MODULE_NAME }}/${{ env.MODULE_VERSION }} + + # Code signing of the packaged module goes here, before it is archived and published. + + - name: Archive Module + run: >- + Compress-Archive + -Path "$env:RUNNER_TEMP/Package/$env:MODULE_NAME" + -DestinationPath "$env:RUNNER_TEMP/$env:MODULE_NAME-v$env:RELEASE_VERSION.zip" + -Force + - name: Upload Module Package + uses: actions/upload-artifact@v7 + with: + name: package + path: ${{ runner.temp }}/${{ env.MODULE_NAME }}-v${{ env.RELEASE_VERSION }}.zip + overwrite: true + - name: Deploy to GitHub + run: >- + ./build/deploy-github.ps1 + -ModuleName $env:MODULE_NAME + -Version $env:RELEASE_VERSION + -Branch '${{ github.ref_name }}' + -Repository '${{ github.repository }}' + -ModulePath "$env:RUNNER_TEMP/Package/$env:MODULE_NAME/$env:MODULE_VERSION" + -ArchivePath "$env:RUNNER_TEMP/$env:MODULE_NAME-v$env:RELEASE_VERSION.zip" + -ReleaseVersionGate $env:RELEASE_VERSION_GATE + -GitUserName $env:GIT_USER_NAME + -ReleaseNotesPath $env:RELEASE_NOTES_PATH + env: + access_token: ${{ secrets.access_token }} + github_email: ${{ secrets.git_email }} + # The commit message is passed via env so quotes in it cannot break the command line. + - name: Deploy to PowerShell Gallery + run: >- + ./build/deploy-psgallery.ps1 + -ModuleName $env:MODULE_NAME + -Version $env:RELEASE_VERSION + -Branch '${{ github.ref_name }}' + -ModulePath "$env:RUNNER_TEMP/Package/$env:MODULE_NAME/$env:MODULE_VERSION" + -ReleaseVersionGate $env:RELEASE_VERSION_GATE + -CommitMessage $env:COMMIT_MESSAGE + env: + psgallery_key: ${{ secrets.psgallery_key }} + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} diff --git a/.gitignore b/.gitignore index a0db64d..ec2f87c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ CLAUDE.md TESTING.md coverage.xml TestResults.xml -codecov.exe \ No newline at end of file +codecov.exe +build/ diff --git a/CHANGELOG.md b/CHANGELOG.md index fbb2196..f965e2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,16 @@ All notable changes to this project will be documented in this file. ## Unreleased -- N/A +### Changed + +- Faster module load, in roughly a quarter of the previous time: the published module is now a single + combined `IdentityCommand.psm1`, instead of over 200 function files loaded one by one at import. +- Documentation site launched at [www.pspete.dev/IdentityCommand](https://www.pspete.dev/IdentityCommand/): + getting started and authentication guides, release notes, and command reference for IdentityCommand + and its companion modules. The module manifest `ProjectUri` now points to it. +- Build, test and release move from AppVeyor to GitHub Actions, using the shared + [pspete.Build](https://github.com/pspete/pspete.Build) scripts. The built module is tested on + Windows PowerShell 5.1, and on PowerShell 7 on Windows and Linux. ## [0.7] - 2026-10-07 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc92527..a777719 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -45,4 +45,4 @@ New-ExternalHelp -Path .\docs\collections\_commands\ -OutputPath .\IdentityComma [OTBS]: https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/81 [new-issue]: https://github.com/pspete/IdentityCommand/issues/new [dev-branch]: https://github.com/pspete/IdentityCommand/tree/dev -[command-help]: https://github.com/pspete/IdentityCommand/tree/master/docs/collections/_commands \ No newline at end of file +[command-help]: https://github.com/pspete/IdentityCommand/tree/main/docs/collections/_commands \ No newline at end of file diff --git a/IdentityCommand/IdentityCommand.psd1 b/IdentityCommand/IdentityCommand.psd1 index 66ae942..c14b1e7 100644 --- a/IdentityCommand/IdentityCommand.psd1 +++ b/IdentityCommand/IdentityCommand.psd1 @@ -273,7 +273,7 @@ LicenseUri = 'https://github.com/pspete/IdentityCommand/blob/main/LICENSE.md' # A URL to the main website for this project. - ProjectUri = 'https://github.com/pspete/IdentityCommand/' + ProjectUri = 'https://www.pspete.dev/IdentityCommand/' # A URL to an icon representing this module. IconUri = 'https://raw.githubusercontent.com/pspete/IdentityCommand/main/docs/media/images/IdentityCommand-Logo.png' diff --git a/IdentityCommand/IdentityCommand.psm1 b/IdentityCommand/IdentityCommand.psm1 index 67df346..d0e6797 100644 --- a/IdentityCommand/IdentityCommand.psm1 +++ b/IdentityCommand/IdentityCommand.psm1 @@ -1,3 +1,4 @@ +#region Loader <# .SYNOPSIS @@ -16,20 +17,6 @@ param( ) -#Named rights for application permission grants (Acl/GetRowAces & SaasManage/SetApplicationPermissions) -#Bit values confirmed live via a Set-IDApplicationPermission/Get-IDApplicationPermission round trip. -#Automatic is bit 31 (2147483648) - written as Int32.MinValue since Windows PowerShell doesn't -#support an explicit enum base type, so this has to fit the default Int32 backing -[Flags()] enum IdApplicationRight { - Grant = 1 - View = 4 - Admin = 8 - ViewDetail = 16 - Delete = 64 - Execute = 128 - Automatic = -2147483648 -} - #Get function files Get-ChildItem $PSScriptRoot\ -Recurse -Include '*.ps1' -Exclude '*.ps1xml' | @@ -56,6 +43,22 @@ Get-ChildItem $PSScriptRoot\ -Recurse -Include '*.ps1' -Exclude '*.ps1xml' | } +#endregion Loader + +#Named rights for application permission grants (Acl/GetRowAces & SaasManage/SetApplicationPermissions) +#Bit values confirmed live via a Set-IDApplicationPermission/Get-IDApplicationPermission round trip. +#Automatic is bit 31 (2147483648) - written as Int32.MinValue since Windows PowerShell doesn't +#support an explicit enum base type, so this has to fit the default Int32 backing +[Flags()] enum IdApplicationRight { + Grant = 1 + View = 4 + Admin = 8 + ViewDetail = 16 + Delete = 64 + Execute = 128 + Automatic = -2147483648 +} + # Script scope session object for session data $ISPSSSession = [ordered]@{ tenant_url = $null diff --git a/IdentityCommand/Private/ConvertTo-QueryString.ps1 b/IdentityCommand/Private/ConvertTo-QueryString.ps1 index ad5c6da..a897124 100644 --- a/IdentityCommand/Private/ConvertTo-QueryString.ps1 +++ b/IdentityCommand/Private/ConvertTo-QueryString.ps1 @@ -21,7 +21,6 @@ Formats input as: "Key=Value&Key=Value" #> [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'FilterList', Justification = 'False Positive')] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', 'NoEscape', Justification = 'False Positive')] [CmdletBinding()] [OutputType('System.String')] param( diff --git a/IdentityCommand/Private/Get-Parameter.ps1 b/IdentityCommand/Private/Get-Parameter.ps1 index 8a14f69..0c7d11a 100644 --- a/IdentityCommand/Private/Get-Parameter.ps1 +++ b/IdentityCommand/Private/Get-Parameter.ps1 @@ -36,8 +36,6 @@ Hashtable/$PSBoundParameters object, with defined parameters removed. #> [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'FilteredParameters', Justification = 'False Positive')] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', 'ParametersToKeep', Justification = 'False Positive')] - [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSReviewUnusedParameter', 'ParametersToRemove', Justification = 'False Positive')] [CmdletBinding(DefaultParameterSetName = 'Remove')] [OutputType('System.Collections.Hashtable')] param( diff --git a/README.md b/README.md index df8a29c..7f059a5 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,23 @@ IdentityCommand is a PowerShell module that wraps the REST API for a Palo Alto Idira (formerly CyberArk) Identity tenant, giving you easy-to-use commands for authentication (including MFA/SAML/OIDC flows) and administration - users, roles, applications, organizations, authentication policies, SCIM provisioning, and more - all from within PowerShell. -The module has been in development for a few years, initially focused on authentication. Coverage is expanding significantly to reach near-complete coverage of the Identity Administration API, and IdentityCommand is also the foundation for a growing family of other `pspete` modules that administer the wider Idira SaaS platform - e.g. [`IdentityCommand.SIA`][sia-repo], which builds on IdentityCommand's authentication to administer Idira Secure Infrastructure Access, and [`IdentityCommand.SCA`][sca-repo] for Idira Secure Cloud Access administration. - -[sia-repo]: https://github.com/pspete/IdentityCommand.SIA -[sca-repo]: https://github.com/pspete/IdentityCommand.SCA +The module has been in development for a few years, initially focused on authentication. Coverage is expanding significantly to reach near-complete coverage of the Identity Administration API, and IdentityCommand is also the foundation for a growing family of other `pspete` modules that administer the wider Idira SaaS platform. Each builds on IdentityCommand's authentication and shared plumbing: + +| Module | Administers | +| --- | --- | +| [`IdentityCommand.AccessRequest`](https://github.com/pspete/IdentityCommand.AccessRequest) | Access Requests | +| [`IdentityCommand.CEM`](https://github.com/pspete/IdentityCommand.CEM) | Cloud Visibility workspace delegation | +| [`IdentityCommand.RemoteAccess`](https://github.com/pspete/IdentityCommand.RemoteAccess) | Remote Access | +| [`IdentityCommand.RiskMgmt`](https://github.com/pspete/IdentityCommand.RiskMgmt) | Risk Management | +| [`IdentityCommand.SCA`](https://github.com/pspete/IdentityCommand.SCA) | Secure Cloud Access | +| [`IdentityCommand.SecretsHub`](https://github.com/pspete/IdentityCommand.SecretsHub) | Secrets Hub | +| [`IdentityCommand.SecretsManager`](https://github.com/pspete/IdentityCommand.SecretsManager) | Secrets Manager, SaaS and Secure Workload Access | +| [`IdentityCommand.SecureAI`](https://github.com/pspete/IdentityCommand.SecureAI) | Secure AI | +| [`IdentityCommand.SIA`](https://github.com/pspete/IdentityCommand.SIA) | Secure Infrastructure Access | +| [`IdentityCommand.UAP`](https://github.com/pspete/IdentityCommand.UAP) | Access Control Policies | +| [`IdentityCommand.UserPortal`](https://github.com/pspete/IdentityCommand.UserPortal) | The user portal (Access API) | + +Documentation, command reference and release notes: [www.pspete.dev/IdentityCommand](https://www.pspete.dev/IdentityCommand/). - **Prior to a Version 1.0.0 release**: - Expect changes, although we will do our best to keep these to a minimum @@ -17,16 +30,14 @@ The module has been in development for a few years, initially focused on authent - Many commands are built from documented API shapes but not yet exercised against a live tenant - see [Help Us Test](#help-us-test) below, your feedback genuinely shapes what ships next. - Most of the Identity Administration API is now covered, but real-world usage is still expected to shape further changes to command names, parameters/parameter names, and how commands are grouped - some may split into companion commands, others may combine. These patterns only emerge once commands are actually used, so don't consider anything final yet. -| Main Branch | Latest Build | CodeFactor | Coverage | PowerShell Gallery | License | -| ------------------------ | ------------------------ | -------------------------- | ---------------------------- | ------------------------- | ---------------------------- | -| [![appveyor][]][av-site] | [![tests][]][tests-site] | [![codefactor][]][cf-site] | [![codecov][]][codecov-link] | [![psgallery][]][ps-site] | [![license][]][license-link] | +| Main Branch | CodeFactor | Coverage | PowerShell Gallery | License | +| ------------------------ | -------------------------- | ---------------------------- | ------------------------- | ---------------------------- | +| [![build][]][build-site] | [![codefactor][]][cf-site] | [![codecov][]][codecov-link] | [![psgallery][]][ps-site] | [![license][]][license-link] | -[appveyor]: https://ci.appveyor.com/api/projects/status/github/pspete/IdentityCommand?branch=main&svg=true -[av-site]: https://ci.appveyor.com/project/pspete/IdentityCommand/branch/main +[build]: https://github.com/pspete/IdentityCommand/actions/workflows/ci.yml/badge.svg?branch=main&event=push +[build-site]: https://github.com/pspete/IdentityCommand/actions/workflows/ci.yml?query=branch%3Amain [psgallery]: https://img.shields.io/powershellgallery/v/IdentityCommand.svg [ps-site]: https://www.powershellgallery.com/packages/IdentityCommand -[tests]: https://img.shields.io/appveyor/tests/pspete/IdentityCommand.svg -[tests-site]: https://ci.appveyor.com/project/pspete/IdentityCommand [downloads]: https://img.shields.io/powershellgallery/dt/IdentityCommand.svg?color=blue [cf-site]: https://www.codefactor.io/repository/github/pspete/IdentityCommand [codefactor]: https://www.codefactor.io/repository/github/pspete/IdentityCommand/badge @@ -153,7 +164,7 @@ Get-Command -Module IdentityCommand | Group-Object { $_.Name.Split('-')[1] -repl Get-Help Get-IDUser -Full ``` -Every command also has a corresponding reference page under [`docs/collections/_commands`](docs/collections/_commands), which is the same content `Get-Help` displays. +Every command also has a reference page on the [documentation site](https://www.pspete.dev/IdentityCommand/) (source: [`docs/collections/_commands`](docs/collections/_commands)), with the same content `Get-Help` displays. | Area | Covers | | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | diff --git a/Tests/Add-IDRolePermission.Tests.ps1 b/Tests/Add-IDRolePermission.Tests.ps1 index c0074e2..5692c97 100644 --- a/Tests/Add-IDRolePermission.Tests.ps1 +++ b/Tests/Add-IDRolePermission.Tests.ps1 @@ -97,7 +97,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { Assert-MockCalled Invoke-IDRestMethod -ParameterFilter { $URI -match 'AssignSuperRights' -and - $($Body | ConvertFrom-Json | Select-Object -First 1 -ExpandProperty Role) -eq 'SomeRole' + $(($Body | ConvertFrom-Json) | Select-Object -First 1 -ExpandProperty Role) -eq 'SomeRole' } -Times 1 -Exactly -Scope It } @@ -122,7 +122,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { Assert-MockCalled Invoke-IDRestMethod -ParameterFilter { $URI -match 'AssignSuperRights' -and - $($Body | ConvertFrom-Json | Select-Object -First 1 -ExpandProperty Role) -eq 'SomeOtherRole' + $(($Body | ConvertFrom-Json) | Select-Object -First 1 -ExpandProperty Role) -eq 'SomeOtherRole' } -Times 1 -Exactly -Scope It } diff --git a/Tests/ConvertTo-SecretBody.Tests.ps1 b/Tests/ConvertTo-SecretBody.Tests.ps1 index 83880c0..3e2f39c 100644 --- a/Tests/ConvertTo-SecretBody.Tests.ps1 +++ b/Tests/ConvertTo-SecretBody.Tests.ps1 @@ -38,7 +38,7 @@ It 'restores an -EmptyArrayProperty to []' { $body = [ordered]@{ 'domains' = @() } | ConvertTo-SecretBody -EmptyArrayProperty domains $json = [System.Text.Encoding]::UTF8.GetString($body) - $json | Should -Match '"domains"\s*:\s*\[\]' + $json | Should -Match '"domains"\s*:\s*\[\s*\]' } It 'leaves other empty-string values untouched' { diff --git a/Tests/Get-IDPersonalApplicationImportLog.Tests.ps1 b/Tests/Get-IDPersonalApplicationImportLog.Tests.ps1 index 33cc3ca..9011c7a 100644 --- a/Tests/Get-IDPersonalApplicationImportLog.Tests.ps1 +++ b/Tests/Get-IDPersonalApplicationImportLog.Tests.ps1 @@ -93,7 +93,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { It 'parses the CSV into objects' { - $response.Count | Should -Be 1 + @($response).Count | Should -Be 1 $response[0].name | Should -Be 'exampleApp' $response[0].Status | Should -Be 'Success' @@ -121,7 +121,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { It 'still parses the CSV into objects' { - $response.Count | Should -Be 1 + @($response).Count | Should -Be 1 $response[0].name | Should -Be 'exampleApp' } diff --git a/Tests/Get-IDUser.Tests.ps1 b/Tests/Get-IDUser.Tests.ps1 index 3d810b6..afdd944 100644 --- a/Tests/Get-IDUser.Tests.ps1 +++ b/Tests/Get-IDUser.Tests.ps1 @@ -179,7 +179,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { It 'outputs expected number of results' { - $response.length | Should -Be 1 + @($response).Count | Should -Be 1 } @@ -251,7 +251,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { It 'outputs expected number of results' { - $response.length | Should -Be 1 + @($response).Count | Should -Be 1 } @@ -308,7 +308,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { It 'outputs expected number of results' { - $response.length | Should -Be 1 + @($response).Count | Should -Be 1 } @@ -365,7 +365,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { It 'outputs expected number of results' { - $response.length | Should -Be 1 + @($response).Count | Should -Be 1 } diff --git a/Tests/Get-MechanismAnswer.Tests.ps1 b/Tests/Get-MechanismAnswer.Tests.ps1 index 02d0e65..5b1fee0 100644 --- a/Tests/Get-MechanismAnswer.Tests.ps1 +++ b/Tests/Get-MechanismAnswer.Tests.ps1 @@ -260,7 +260,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { It 'displays complexity hint' { Get-MechanismAnswer -Mechanism $Mechanism -Credential $Creds Assert-MockCalled -CommandName Write-Host -Times 1 -ParameterFilter { - $Message -eq 'More Cowbell' + $Object -eq 'More Cowbell' } -Scope It -Exactly } It 'prompts for new password' { diff --git a/Tests/IdentityCommand.Tests.ps1 b/Tests/IdentityCommand.Tests.ps1 index 9df0e19..ff93bbd 100644 --- a/Tests/IdentityCommand.Tests.ps1 +++ b/Tests/IdentityCommand.Tests.ps1 @@ -1,230 +1,22 @@ -#Requires -Modules Pester, PSScriptAnalyzer +#Requires -Modules Pester <# .SYNOPSIS - Tests module for consistency, expected structures, settings, components & files. + Tests IdentityCommand-specific conventions across the module. .EXAMPLE Invoke-Pester .NOTES - A generic set of tests to apply to a module + The generic module tests come from pspete.Build (build/tests/Module.Tests.ps1). + The built module is a single psm1 with no Public folder, so Secure Value Handling finds no scripts to check against it. #> Describe 'Module' -Tag 'Consistency' { - #Get Current Directory - $Here = Split-Path -Parent $PSCommandPath + $ModuleName = 'IdentityCommand' - #Assume ModuleName from Repository Root folder - $ModuleName = Split-Path (Split-Path $Here -Parent) -Leaf - - #Resolve Path to Module Directory - $ModulePath = Resolve-Path "$Here\..\$ModuleName" - - #Define Path to Module Manifest - $ManifestPath = Join-Path "$ModulePath" "$ModuleName.psd1" - - Get-Module -Name $ModuleName -All | Remove-Module -Force -ErrorAction Ignore - - $Module = Import-Module -Name "$ManifestPath" -ArgumentList $true -Force -ErrorAction Stop -PassThru - - #Get Public Function Names - $PublicFunctions = Get-ChildItem "$ModulePath\Public" -Include *.ps1 -Recurse | Select-Object -ExpandProperty BaseName - - #Get Exported Function Names - $ExportedFunctions = $Module.ExportedFunctions.Values.name - - $ExportedAliases = $Module.ExportedAliases.Values.name + $ModulePath = Join-Path (Split-Path (Split-Path -Parent $PSCommandPath) -Parent) $ModuleName $Scripts = Get-ChildItem $ModulePath -Include *.ps1 -Recurse - Context $ManifestPath -Tag Manifest { - - It 'has a valid manifest' -TestCases @{ManifestPath = $ManifestPath } { - param($ManifestPath) - { $null = Test-ModuleManifest -Path $ManifestPath -ErrorAction Stop -WarningAction SilentlyContinue } | - Should -Not -Throw - - } - - It 'specifies valid root module' -TestCases @{RootModule = $Module.RootModule ; ModuleName = $ModuleName } { - param($RootModule, $ModuleName) - $RootModule | Should -Be "$ModuleName.psm1" - - } - - It 'has a valid description' -TestCases @{Description = $Module.Description } { - param($Description) - $Description | Should -Not -BeNullOrEmpty - - } - - It 'has a valid guid' -TestCases @{Guid = $Module.Guid } { - param($Guid) - $Guid | Should -Be 'f6bb2bdf-0c53-443f-be07-3c25264a09b1' - - } - - It 'has a valid copyright' -TestCases @{Copyright = $Module.Copyright } { - param($Copyright) - $Copyright | Should -Not -BeNullOrEmpty - - } - - Context 'Files To Process' -Tag 'FilesToProcess' { - - foreach ($file in ($Module.ExportedFormatFiles)) { - Context $file -Tag 'FormatData' { - It 'exists' -TestCases @{ - 'File' = $file - } { - param($File) - $File | Should -Exist - } - - It 'is valid' -TestCases @{ - 'File' = $file - } { - param($File) - { Update-FormatData -AppendPath $File -ErrorAction Stop -WarningAction SilentlyContinue } | Should -Not -Throw - } - - } - - foreach ($file in ($Module.ExportedTypeFiles)) { - Context $file -Tag 'TypeData' { - It 'exists' -TestCases @{ - 'File' = $file - } { - param($File) - $File | Should -Exist - } - - It 'is valid' -TestCases @{ - 'File' = $file - } { - param($File) - { Update-TypeData -AppendPath $File -ErrorAction Stop -WarningAction SilentlyContinue } | Should -Not -Throw - } - - } - } - } - } - - Context 'Exported Function Analysis' -Tag 'Functions' { - - It 'exports the expected number of functions' { - - ($PublicFunctions | Measure-Object | Select-Object -ExpandProperty Count) | - - Should -Be ($ExportedFunctions | Measure-Object | Select-Object -ExpandProperty Count) - - } - - foreach ($ExportedFunction in $ExportedFunctions) { - - Context "$ExportedFunction" -Tag "$ExportedFunction" { - It 'is public' -TestCases @{ - 'ExportedFunction' = $ExportedFunction - 'PublicFunctions' = $PublicFunctions - } { - param($ExportedFunction, $PublicFunctions) - $PublicFunctions | Should -Contain $ExportedFunction - } - - It 'has a related pester tests file' -TestCases @{ - 'ExportedFunction' = $ExportedFunction - 'Here' = $here - } { - param($ExportedFunction, $here) - Test-Path (Join-Path $here "$ExportedFunction.Tests.ps1") | Should -Be $true - } - - Context Help -Tag 'Help' { - - $help = Get-Help $ExportedFunction -Full - - It 'has synopsis' -TestCases @{ 'Help' = $help } { - param($help) - $help.synopsis | Should -Not -BeNullOrEmpty - - } - - It 'has description' -TestCases @{ 'Help' = $help } { - param($help) - $help.description | Should -Not -BeNullOrEmpty - - } - - It 'has example code' -TestCases @{ 'Help' = $help } { - param($help) - $help.examples.example.code | Should -Not -BeNullOrEmpty - - } - - [array]$HelpParameters = $help.parameters.parameter | Where-Object name -NotIn @('WhatIf', 'Confirm') - - foreach ($HelpParameter in $HelpParameters) { - - It 'has description of parameter ' -Tag "$($HelpParameter.name)" -TestCases @{ - 'description' = $HelpParameter.description - 'name' = $HelpParameter.name - } { - param($description, $name) - $description | Should -Not -BeNullOrEmpty - } - - } - - } - } - - } - - } - - Context 'Exported Alias Analysis' -Tag Alias { - - foreach ($Alias in $ExportedAliases) { - - It ' resolves to public function' -Tag $Alias -TestCases @{ - 'Alias' = $Alias - 'PublicFunctions' = $PublicFunctions - } { - param($Alias, $PublicFunctions) - $PublicFunctions | Should -Contain $((Get-Alias $Alias).ResolvedCommand.Name) - } - - } - - } - - } - - Context 'PSScriptAnalyzer Analysis' -Tag 'PSScriptAnalyzer' { - - Foreach ($Script in $scripts) { - - Context $Script.Name -Tag "$($Script.BaseName)", "$($Script.Name)" { - - It 'passes all Warning and Error rules' -TestCases @{ - 'FilePath' = $script.FullName - } { - param($FilePath) - - #One analyzer pass per file (all Warning/Error rules at once) rather than one pass per rule - $findings = Invoke-ScriptAnalyzer -Path $FilePath -Severity Warning, Error - - ($findings | ForEach-Object { "[$($_.RuleName)] line $($_.Line): $($_.Message)" }) -join [System.Environment]::NewLine | - Should -BeNullOrEmpty - - } - - } - - } - - } - Context 'Secure Value Handling' -Tag 'SecureValueHandling' { #Any function that decodes a SecureString (or otherwise obtains a plaintext secret - e.g. @@ -261,20 +53,25 @@ Describe 'Module' -Tag 'Consistency' { } + #The pattern-based scan above can't see a secret that only exists in the *caller's* data #The pattern-based scan above can't see a secret that only exists in the *caller's* data #(e.g. a hashtable value passed in via a parameter) rather than as literal source text in #the file itself - these are known to handle a secret this way, so are named explicitly - 'Set-IDUserSecurityQuestion.ps1', 'Submit-PersonalApplicationCsvImport.ps1', 'Test-PersonalApplicationCsvImport.ps1' | ForEach-Object { + if ($Scripts) { - $ScriptName = $PSItem - $Script = $Scripts | Where-Object Name -EQ $ScriptName + 'Set-IDUserSecurityQuestion.ps1', 'Submit-PersonalApplicationCsvImport.ps1', 'Test-PersonalApplicationCsvImport.ps1' | ForEach-Object { - It "$ScriptName converts its request body to UTF8 bytes before calling Invoke-IDRestMethod" -Tag "$($Script.BaseName)" -TestCases @{ - 'Content' = Get-Content -Path $Script.FullName -Raw - } { - param($Content) + $ScriptName = $PSItem + $Script = $Scripts | Where-Object Name -EQ $ScriptName - $Content | Should -Match '\[System\.Text\.Encoding\]::UTF8\.GetBytes\(' + It "$ScriptName converts its request body to UTF8 bytes before calling Invoke-IDRestMethod" -Tag "$($Script.BaseName)" -TestCases @{ + 'Content' = Get-Content -Path $Script.FullName -Raw + } { + param($Content) + + $Content | Should -Match '\[System\.Text\.Encoding\]::UTF8\.GetBytes\(' + + } } @@ -282,4 +79,4 @@ Describe 'Module' -Tag 'Consistency' { } -} \ No newline at end of file +} diff --git a/Tests/Out-QRImage.Tests.ps1 b/Tests/Out-QRImage.Tests.ps1 index f843a90..8943506 100644 --- a/Tests/Out-QRImage.Tests.ps1 +++ b/Tests/Out-QRImage.Tests.ps1 @@ -38,7 +38,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { It 'does not throw' { - { $Object | Out-QRImage -Path 'C:\Temp' } | Should -Not -Throw + { $Object | Out-QRImage -Path ([System.IO.Path]::GetTempPath()) } | Should -Not -Throw } diff --git a/Tests/Remove-IDRolePermission.Tests.ps1 b/Tests/Remove-IDRolePermission.Tests.ps1 index 199015b..3a7f02f 100644 --- a/Tests/Remove-IDRolePermission.Tests.ps1 +++ b/Tests/Remove-IDRolePermission.Tests.ps1 @@ -97,7 +97,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { Assert-MockCalled Invoke-IDRestMethod -ParameterFilter { $URI -match 'UnAssignSuperRights' -and - $($Body | ConvertFrom-Json | Select-Object -First 1 -ExpandProperty Role) -eq 'SomeRole' + $(($Body | ConvertFrom-Json) | Select-Object -First 1 -ExpandProperty Role) -eq 'SomeRole' } -Times 1 -Exactly -Scope It } @@ -122,7 +122,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { Assert-MockCalled Invoke-IDRestMethod -ParameterFilter { $URI -match 'UnAssignSuperRights' -and - $($Body | ConvertFrom-Json | Select-Object -First 1 -ExpandProperty Role) -eq 'SomeOtherRole' + $(($Body | ConvertFrom-Json) | Select-Object -First 1 -ExpandProperty Role) -eq 'SomeOtherRole' } -Times 1 -Exactly -Scope It } diff --git a/Tests/Start-AdvanceAuthentication.Tests.ps1 b/Tests/Start-AdvanceAuthentication.Tests.ps1 index a33c68b..530d11c 100644 --- a/Tests/Start-AdvanceAuthentication.Tests.ps1 +++ b/Tests/Start-AdvanceAuthentication.Tests.ps1 @@ -261,7 +261,7 @@ Describe $($PSCommandPath -Replace '.Tests.ps1') { $LogonRequest | Start-AdvanceAuthentication -Mechanism $Mechanism -Answer 'SomeAnswer' Assert-MockCalled Remove-Item -Times 1 -Scope It -Exactly -ParameterFilter { - $Path -eq $(Join-Path $([Environment]::GetEnvironmentVariable('Temp')) 'SomeSession.html') + $Path -eq $(Join-Path $([System.IO.Path]::GetTempPath()) 'SomeSession.html') } } diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 4b3b80b..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,58 +0,0 @@ -# version format -version: 0.7.{build} - -environment: - #GIT_TRACE: 1 - # Plain (non-secret) config: - git_user_name: 'Pete Maan' - github_repo_owner: 'pspete' - - # Secure variables: - access_token: - secure: nXh9mZ0YD5M116yhStlR/Tzg+Kf+D6CUpNP+tIlWdNTVxNjVzT2vzl8wOD8kvtOiSORSWDsyvKZVx2+IsA0A1X05ohYwmkXQIF9TaPHiHtFmym8Y5btpRO/2AaWMfmIJ - psgallery_key: - secure: FuPgJskczZMptxRgdUlBAy7OYmXBQl4zq86kXXSmBt6wKudnM2PK7W6cM7bj0te1 - coveralls_key: - secure: bdyanCqxWP0hylNYUvdIl8eUlDMhmIsmeFUNxGwnESlEksBZnxcLhaj1lYVuD7LM - github_email: - secure: x5ljenzXfYXkzpEu9eX7AQvb3AkFbiXG2NndMzw9Zc4= - CODECOV_TOKEN: - secure: nv7Kt2ldlcFCfK7zX17RrienKXeUQ3AoTZog8m7emylxI3WxUFnJnMV7Ja5gz5/A - -skip_tags: true - -skip_commits: - files: - - docs\* - - .github\* - - .vscode\* - - README.md - - LICENSE.md - - CONTRIBUTING.md - - CODE_OF_CONDUCT.md - - ISSUE_TEMPLATE.md - - PULL_REQUEST_TEMPLATE.md - - appveyor.yml - - CHANGELOG.md - message: /update readme.*|update version.*|update appveyor.*/ - -only_commits: - files: - - build\ - - IdentityCommand\ - - Tests\ - -image: Visual Studio 2019 - -install: - - pwsh.exe -File .\build\install.ps1 - -build_script: - - pwsh.exe -File .\build\build.ps1 - -test_script: - - pwsh.exe -File .\build\test.ps1 - -deploy_script: - - pwsh.exe -File .\build\deploy-github.ps1 - - pwsh.exe -File .\build\deploy-psgallery.ps1 \ No newline at end of file diff --git a/build/build.ps1 b/build/build.ps1 deleted file mode 100644 index 26518fc..0000000 --- a/build/build.ps1 +++ /dev/null @@ -1,102 +0,0 @@ -#---------------------------------# -# Header # -#---------------------------------# -Write-Host 'Build Information:' -ForegroundColor Yellow - -#Get current module version from manifest -$ManifestPath = Join-Path "$pwd" $(Join-Path "$env:APPVEYOR_PROJECT_NAME" "$env:APPVEYOR_PROJECT_NAME.psd1") -$CurrentVersion = (Import-PowerShellDataFile $ManifestPath).ModuleVersion - -#display module information -Write-Host "ModuleName : $env:APPVEYOR_PROJECT_NAME" -Write-Host "Build version : $env:APPVEYOR_BUILD_VERSION" -Write-Host "Manifest version : $CurrentVersion" -Write-Host "Author : $env:APPVEYOR_REPO_COMMIT_AUTHOR" -Write-Host "Branch : $env:APPVEYOR_REPO_BRANCH" -Write-Host "Build Folder : $env:APPVEYOR_BUILD_FOLDER" - -If ([System.Version]$($env:APPVEYOR_BUILD_VERSION) -le [System.Version]$CurrentVersion) { - - throw "Build Version Not Greater than Current Version" - -} -Else { - - Try { - - #---------------------------------# - # BuildScript # - #---------------------------------# - #---------------------------------# - # Update module manifest # - #---------------------------------# - Write-Host "Updating Manifest Version to $env:APPVEYOR_BUILD_VERSION" -ForegroundColor Cyan - - #Replace version in manifest with build version from appveyor - ((Get-Content $ManifestPath).replace("= '$($currentVersion)'", "= '$($env:APPVEYOR_BUILD_VERSION)'")) | Set-Content $ManifestPath -ErrorAction Stop - - <#-- Package Version Release --#> - $Directory = New-Item -ItemType Directory -Path "Release\$($env:APPVEYOR_PROJECT_NAME)\$($env:APPVEYOR_BUILD_VERSION)" -Force -ErrorAction Stop - $OutputArchive = "$($env:APPVEYOR_PROJECT_NAME)-v$($env:APPVEYOR_BUILD_VERSION).zip" - - $OutputArchive = "$($env:APPVEYOR_PROJECT_NAME)-v$($env:APPVEYOR_BUILD_VERSION).zip" - $ReleaseSource = $(Resolve-Path .\$env:APPVEYOR_PROJECT_NAME) - - <#-- Create Release Folder --#> - $Directory = New-Item -ItemType Directory -Path "..\Release\$($env:APPVEYOR_PROJECT_NAME)\$($env:APPVEYOR_BUILD_VERSION)" -Force -ErrorAction Stop - - <#-- Copy Module Files --#> - Copy-Item -Path $ReleaseSource\* -Recurse -Destination $($Directory.Fullname) -Force -ErrorAction Stop - - - If ((-not ($ENV:APPVEYOR_PULL_REQUEST_NUMBER)) -and (($ENV:APPVEYOR_REPO_BRANCH -eq 'main') -and ([version]$ENV:APPVEYOR_BUILD_VERSION -ge [version]"1.0.0"))) { - - If (($ENV:sig_key) -and ($ENV:PfxSecure)) { - - Write-Host "Signing Files" -ForegroundColor Cyan - - Try { - $KeyPath = Join-Path $([System.Environment]::GetEnvironmentVariable("TEMP")) cert.pfx - [IO.File]::WriteAllBytes($KeyPath, [Convert]::FromBase64String($($env:sig_key))) - - $SecurePW = ConvertTo-SecureString -String $($env:PfxSecure) -Force -AsPlainText - $Cred = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList "UserName", $SecurePW - - $Cert = Get-ChildItem -Path $KeyPath | Import-PfxCertificate -CertStoreLocation "Cert:\CurrentUser\My" -Password $Cred.Password - - $null = Get-ChildItem -Path "$($Directory.Fullname)\*.ps*" -Recurse | Set-AuthenticodeSignature -Certificate $Cert -TimestampServer 'http://timestamp.digicert.com' - $null = New-FileCatalog -CatalogVersion 2 -CatalogFilePath "$($Directory.Fullname)\$($env:APPVEYOR_PROJECT_NAME).cat" -Path $($Directory.Fullname) - $null = Set-AuthenticodeSignature -Certificate $Cert -TimestampServer 'http://timestamp.digicert.com' -FilePath "$($Directory.Fullname)\$($env:APPVEYOR_PROJECT_NAME).cat" - } - Catch { - Throw $_ - } - Finally { - - Get-ChildItem -Path "Cert:\CurrentUser\My" -Recurse -CodeSigningCert | Remove-Item -Force - Remove-Item -Path $KeyPath -Force - Remove-Variable -Name SecurePW -Force - Remove-Variable -Name Cred -Force - - } - - } - - } - - <#-- Create Package ---#> - Compress-Archive $Directory -DestinationPath ..\$OutputArchive -ErrorAction Stop - - <#-- Release Artifact --#> - Write-Host "Release Artifact : $OutputArchive" - Push-AppveyorArtifact ..\$OutputArchive -FileName $OutputArchive -DeploymentName "$env:APPVEYOR_PROJECT_NAME-latest" - - } - - Catch { - - throw $_ - - } - -} \ No newline at end of file diff --git a/build/deploy-github.ps1 b/build/deploy-github.ps1 deleted file mode 100644 index 7ada822..0000000 --- a/build/deploy-github.ps1 +++ /dev/null @@ -1,120 +0,0 @@ -<#--------------------------------- -Update version number on GitHub to match build version - -Requires these plain (non-secret) environment variables to be set in appveyor.yml: - git_user_name - e.g. 'Pete Maan' - github_repo_owner - e.g. 'pspete' -(github_email and access_token remain secure variables) ----------------------------------#> - - -if (-not ($ENV:APPVEYOR_PULL_REQUEST_NUMBER)) { - - If ($ENV:APPVEYOR_REPO_BRANCH -eq 'main') { - - <# Master Branch #> - Write-Host 'Deploy Process: GitHub Repository' -ForegroundColor Yellow - - <#---------------------------------#> - <# If Not a PR #> - <# Push psd1 file to ORIGIN Branch #> - <#---------------------------------#> - - Try { - - Write-Host "Push Updated $($env:APPVEYOR_PROJECT_NAME).psd1 to GitHub..." -ForegroundColor Yellow - - git config --global core.safecrlf false - git config --global credential.helper store - Add-Content "$HOME\.git-credentials" "https://$($env:access_token):x-oauth-basic@github.com`n" - git config --global user.email "$($env:github_email)" - git config --global user.name "$($env:git_user_name)" - - git checkout -q $($ENV:APPVEYOR_REPO_BRANCH) - - git add $(Join-Path -Path (Join-Path -Path "$env:APPVEYOR_BUILD_FOLDER" -ChildPath "$env:APPVEYOR_PROJECT_NAME") -ChildPath "$env:APPVEYOR_PROJECT_NAME.psd1") - - git status - - git commit -s -m "Update Version: $($env:APPVEYOR_BUILD_VERSION)" - - git push --porcelain origin $($ENV:APPVEYOR_REPO_BRANCH) - - Write-Host "$($env:APPVEYOR_PROJECT_NAME) version $($env:APPVEYOR_BUILD_VERSION) pushed to GitHub." -ForegroundColor Cyan - - } - - Catch { - - Write-Host 'Push to GitHub failed.' -ForegroundColor Red - throw $_ - - } - - Write-Host 'Deploy Process: GitHub Release' -ForegroundColor Yellow - - If ([version]$env:APPVEYOR_BUILD_VERSION -ge [version]'0.1.0') { - - <# Create New Release #> - - $token = $env:access_token - $uploadFilePath = Resolve-Path "..\$($env:APPVEYOR_PROJECT_NAME)-v$($env:APPVEYOR_BUILD_VERSION).zip" - $releaseName = "v$($env:APPVEYOR_BUILD_VERSION)" - $repo = "$($env:github_repo_owner)/$env:APPVEYOR_PROJECT_NAME" - - $headers = @{ - 'Authorization' = "token $token" - 'Content-type' = 'application/json' - } - - $body = @{ - tag_name = $releaseName - name = $releaseName - body = "$($env:APPVEYOR_PROJECT_NAME) v$($env:APPVEYOR_BUILD_VERSION)" - draft = $false - prerelease = $false - } - - Write-Host "Creating release $releaseName..." -NoNewline - - try { - $json = (ConvertTo-Json $body) - $release = Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/releases" -Headers $headers -Method POST -Body $json - $uploadUrl = $release.upload_url.Replace('{?name,label}', '') + '?name=' + [IO.Path]::GetFileName($uploadFilePath) - Write-Host 'OK' -ForegroundColor Green - - Write-Host "Uploading asset $($env:APPVEYOR_PROJECT_NAME)-v$($env:APPVEYOR_BUILD_VERSION).zip..." -NoNewline - - $data = [System.IO.File]::ReadAllBytes($uploadFilePath) - $wc = New-Object Net.WebClient - $wc.Headers['Content-type'] = 'application/octet-stream' - $wc.Headers['Authorization'] = "token $token" - - $null = $wc.UploadData($uploadUrl, 'POST', $data) - Write-Host 'OK' -ForegroundColor Green - } catch { - - Write-Host 'GitHub Release Failed.' -ForegroundColor Red - throw $_ - - } - - } - - } - - Else { - - <# Not Master Branch #> - Write-Host "$ENV:APPVEYOR_REPO_BRANCH Branch; No Release" -ForegroundColor Cyan - exit - - } - -} - -Else { - - Write-Host 'Skipping Deploy Process: GitHub Repository' -ForegroundColor Yellow - -} \ No newline at end of file diff --git a/build/deploy-psgallery.ps1 b/build/deploy-psgallery.ps1 deleted file mode 100644 index 5a3f458..0000000 --- a/build/deploy-psgallery.ps1 +++ /dev/null @@ -1,68 +0,0 @@ -<#--------------------------------- -Auto-publish changes to master branch as a new module version in the PSGallery. -- Only publish if build version is greater than 1.0 -- Skip Auto-publish with specific commit message of "Manual Deployment" ----------------------------------#> - - -if (-not ($ENV:APPVEYOR_PULL_REQUEST_NUMBER)) { - - <#---------------------------------#> - <# If Not a PR #> - <#---------------------------------#> - If (($ENV:APPVEYOR_REPO_BRANCH -eq 'main') -and ([version]$env:APPVEYOR_BUILD_VERSION -ge [version]'0.1.0')) { - - <# Master Branch #> - <# Version 0.1.0+ #> - - Write-Host 'Deploy Process: PowerShell Gallery' -ForegroundColor Yellow - - If ($ENV:APPVEYOR_REPO_COMMIT_MESSAGE -eq 'Manual Deployment') { - - <# Manual Deploy to PSGallery #> - Write-Host "Finished testing of branch: $env:APPVEYOR_REPO_BRANCH" -ForegroundColor Cyan - Write-Host 'Manual Deployment to PSGallery Required' -ForegroundColor Cyan - Write-Host 'Exiting' -ForegroundColor Cyan - exit - - } Else { - - <#---------------------------------# - # Publish to PS Gallery # - #----------------------------------#> - - $ModulePath = Resolve-Path "..\Release\$($env:APPVEYOR_PROJECT_NAME)\$($env:APPVEYOR_BUILD_VERSION)" - - Write-Host "Publish $($env:APPVEYOR_PROJECT_NAME) $($env:APPVEYOR_BUILD_VERSION) to Powershell Gallery......" -NoNewline - - Try { - - Publish-Module -Path $ModulePath -NuGetApiKey $($env:psgallery_key) -SkipAutomaticTags -Confirm:$false -ErrorAction Stop -Force - - Write-Host 'OK' -ForegroundColor Green - - } Catch { - - Write-Host "Failed - $_." -ForegroundColor Red - throw $_ - - } Finally { - exit - } - - } - - } Else { - - <# No Deployment #> - - Write-Host "Finished testing: $($env:APPVEYOR_PROJECT_NAME) $env:APPVEYOR_REPO_BRANCH ($($env:APPVEYOR_BUILD_VERSION)) - Exiting" -ForegroundColor Cyan - exit - - } - -} Else { - - Write-Host 'Skipping Deploy Process: PowerShell Gallery' -ForegroundColor Yellow - -} \ No newline at end of file diff --git a/build/install.ps1 b/build/install.ps1 deleted file mode 100644 index 74ee679..0000000 --- a/build/install.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -#---------------------------------# -# Header # -#---------------------------------# -Write-Host 'Installing Required Modules:' -ForegroundColor Yellow - -$RequiredModules = @( - @{ Name = 'PowerShellGet' } - @{ Name = 'Pester'; RequiredVersion = '5.7.1' } - @{ Name = 'PSScriptAnalyzer' } -) - -#---------------------------------# -# Install NuGet # -#---------------------------------# -if (-not $IsCoreCLR) { - Write-Host "`tNuGet..." - $pkg = Install-PackageProvider -Name NuGet -Confirm:$false -Force -ErrorAction Stop - Write-Host "`t`tInstalled NuGet version '$($pkg.version)'" -} - -#---------------------------------# -# Install Required Modules # -#---------------------------------# -foreach ($Module in $RequiredModules) { - - try { - Write-Host "`tInstalling: $($Module.Name)..." -NoNewline - $InstallParams = @{ - Name = $Module.Name - Repository = 'PSGallery' - Confirm = $false - Force = $true - SkipPublisherCheck = $true - ErrorAction = 'Stop' - } - if ($Module.RequiredVersion) { - $InstallParams.RequiredVersion = $Module.RequiredVersion - } - Install-Module @InstallParams | Out-Null - Write-Host ' OK' -ForegroundColor Green - } catch { - Write-Host 'Error' -ForegroundColor Red - throw $_ - } - -} \ No newline at end of file diff --git a/build/test.ps1 b/build/test.ps1 deleted file mode 100644 index 1ee7d31..0000000 --- a/build/test.ps1 +++ /dev/null @@ -1,67 +0,0 @@ -#---------------------------------# -# Header # -#---------------------------------# -Write-Host "Testing: PSVersion $($PSVersionTable.PSVersion)" -ForegroundColor Yellow -$ManifestPath = Join-Path "$pwd" $(Join-Path "$env:APPVEYOR_PROJECT_NAME" "$env:APPVEYOR_PROJECT_NAME.psd1") -Import-Module Pester -RequiredVersion 5.7.1 -Force -Import-Module $ManifestPath -ArgumentList $true -Force -#---------------------------------# -# Run Pester Tests # -#---------------------------------# -$files = Get-ChildItem $(Join-Path $ENV:APPVEYOR_BUILD_FOLDER $env:APPVEYOR_PROJECT_NAME) -Include *.ps1 -Recurse | Select-Object -ExpandProperty FullName - -# get default from static property -$configuration = [PesterConfiguration]::Default -# assing properties & discover via intellisense -$configuration.Run.Path = '.\Tests' -$configuration.Run.PassThru = $true -$configuration.CodeCoverage.Enabled = $true -$configuration.CodeCoverage.Path = $files -$configuration.CodeCoverage.OutputFormat = 'JaCoCo' -$configuration.CodeCoverage.OutputPath = '.\coverage.xml' -$configuration.TestResult.Enabled = $true -$configuration.TestResult.OutputFormat = 'JUnitXml' -$configuration.TestResult.OutputPath = '.\TestResults.xml' -$configuration.Output.Verbosity = 'Minimal' - -$result = Invoke-Pester -Configuration $configuration - -$res = $result | ConvertTo-Pester4Result - -Write-Host 'Uploading Test Results.' -$null = (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", $(Resolve-Path .\TestResults.xml)) - -if (($env:APPVEYOR_REPO_COMMIT_AUTHOR -eq $env:git_user_name) -and -not [string]::IsNullOrWhiteSpace($env:CODECOV_TOKEN)) { - - #CODECOV_TOKEN is a secure variable and is not exposed to pull request builds - skip the upload rather than - #invoking the CLI with an empty -t value (which shifts every following argument and fails the command). - - Write-Host 'Publishing Code Coverage' - - try { - $ProgressPreference = 'SilentlyContinue' - $null = Invoke-WebRequest -Uri 'https://cli.codecov.io/latest/windows/codecov.exe' -OutFile codecov.exe - .\codecov.exe --disable-telem upload-process --disable-search --fail-on-error -t "$env:CODECOV_TOKEN" -n 'appveyor' -f coverage.xml - .\codecov.exe --disable-telem do-upload --disable-search --fail-on-error -t "$env:CODECOV_TOKEN" --report-type test_results -f TestResults.xml - } catch { - Write-Warning "Code coverage upload failed: $_" - } - - Remove-Item -Path .\codecov.exe -Force -ErrorAction SilentlyContinue - -} - -Remove-Item -Path $(Resolve-Path .\coverage.xml) -Force -Remove-Item -Path $(Resolve-Path .\TestResults.xml) -Force -#---------------------------------# -# Validate # -#---------------------------------# -if (($res.FailedCount -gt 0) -or ($res.PassedCount -eq 0)) { - - throw "$($res.FailedCount) tests failed." - -} else { - - Write-Host 'All tests passed' -ForegroundColor Green - -} \ No newline at end of file From 33d86300ea24706f26f9e475e1bf4d7a86a72ae4 Mon Sep 17 00:00:00 2001 From: Pete Maan Date: Thu, 8 Oct 2026 21:55:53 +0100 Subject: [PATCH 6/7] Update CHANGELOG.md --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f965e2e..cb040e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,16 @@ All notable changes to this project will be documented in this file. ## Unreleased -### Changed +### Added - Faster module load, in roughly a quarter of the previous time: the published module is now a single combined `IdentityCommand.psm1`, instead of over 200 function files loaded one by one at import. - Documentation site launched at [www.pspete.dev/IdentityCommand](https://www.pspete.dev/IdentityCommand/): getting started and authentication guides, release notes, and command reference for IdentityCommand and its companion modules. The module manifest `ProjectUri` now points to it. + +## Changed + - Build, test and release move from AppVeyor to GitHub Actions, using the shared [pspete.Build](https://github.com/pspete/pspete.Build) scripts. The built module is tested on Windows PowerShell 5.1, and on PowerShell 7 on Windows and Linux. From 3f11f51b0cbf05696aa2aaa0c6eb8b955abedf34 Mon Sep 17 00:00:00 2001 From: Pete Maan Date: Thu, 8 Oct 2026 21:58:44 +0100 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=93=9D=20Fix=20Changed=20heading=20le?= =?UTF-8?q?vel=20in=20CHANGELOG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb040e9..d1b908c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ All notable changes to this project will be documented in this file. getting started and authentication guides, release notes, and command reference for IdentityCommand and its companion modules. The module manifest `ProjectUri` now points to it. -## Changed +### Changed - Build, test and release move from AppVeyor to GitHub Actions, using the shared [pspete.Build](https://github.com/pspete/pspete.Build) scripts. The built module is tested on