Invoke-FabricGitCommit
Commits changes from a Fabric workspace to the connected Git branch.
Syntax
Invoke-FabricGitCommit [-WorkspaceId] <guid> [[-Comment] <string>] [[-Item] <Object[]>]
[[-WorkspaceHead] <string>] [-NoAutoResolve] [-NoWait] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Commits workspace changes to the Git branch the workspace is connected to. Without -Item, all changes are committed (mode 'All'). With -Item, only the given items are committed (mode 'Selective'). Items can be piped in from Get-FabricGitStatus -ChangesOnly.
If -WorkspaceHead is not supplied, it is looked up with Get-FabricGitStatus just before the commit. Use -NoAutoResolve to turn off this lookup.
Examples
Example 1
Invoke-FabricGitCommit -WorkspaceId '11111111-1111-1111-1111-111111111111' -Comment 'Nightly sync'Commits all workspace changes.
Example 2
Get-FabricGitStatus -WorkspaceId '11111111-1111-1111-1111-111111111111' -ChangesOnly | Where-Object ItemType -eq 'Notebook' | Invoke-FabricGitCommit -Comment 'Notebooks only'Commits only the changed notebooks.
Parameters
| Name | Type | Req. | Pos. | Pipeline | Description |
|---|---|---|---|---|---|
| -WorkspaceIdalias: Id | guid | ✓Required | 0 | By name | The ID of the workspace. Accepts pipeline input by property name (alias Id). |
| -Comment | string | 1 | – | The commit message. Maximum 300 characters. |
|
| -Confirmalias: cf | switch | Named | – | Prompts you for confirmation before running the cmdlet. |
|
| -Item | object[] | 2 | Value | Items to commit. Each object must have ObjectId and/or LogicalId properties (as returned by Get-FabricGitStatus -ChangesOnly), or be a raw change from Get-FabricGitStatus (with itemMetadata.itemIdentifier). Accepts pipeline input. |
|
| -NoAutoResolve | switch | Named | – | Does not look up WorkspaceHead automatically. WorkspaceHead is then sent only if supplied. Default: False |
|
| -NoWait | switch | Named | – | Returns the long-running operation details instead of waiting for it to finish. Default: False |
|
| -WhatIfalias: wi | switch | Named | – | Runs the command in a mode that only reports what would happen without performing the actions. |
|
| -WorkspaceHead | string | 3 | – | The full SHA hash the workspace is synced to. Looked up automatically when omitted. |
This cmdlet also supports the common parameters, such as -Verbose and -ErrorAction. See about_CommonParameters.
Inputs
System.Guid
{{ Fill in the Description }}
System.Object[]
{{ Fill in the Description }}
Notes
https://learn.microsoft.com/en-us/rest/api/fabric/core/git/commit-to-git
Requires the workspace Contributor role or higher.
Author: Kamil Nowinski