Invoke-FabricGitUpdate
Updates a Fabric workspace with the latest commits from the connected Git branch.
Syntax
Invoke-FabricGitUpdate [-WorkspaceId] <guid> [[-RemoteCommitHash] <string>]
[[-WorkspaceHead] <string>] [[-ConflictResolutionPolicy] <string>] [-AllowOverrideItems]
[-NoAutoResolve] [-NoWait] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Updates the workspace with commits pushed to the connected branch. Workspace items may be overwritten, so the cmdlet asks for confirmation by default; use -Confirm:$false to skip the prompt.
If -RemoteCommitHash or -WorkspaceHead are not supplied, they are looked up with Get-FabricGitStatus just before the update. Use -NoAutoResolve to turn off this lookup; -RemoteCommitHash is then required.
Examples
Example 1
Invoke-FabricGitUpdate -WorkspaceId '11111111-1111-1111-1111-111111111111' -Confirm:$falseUpdates the workspace to the latest remote commit without prompting.
Example 2
Invoke-FabricGitUpdate -WorkspaceId '11111111-1111-1111-1111-111111111111' -ConflictResolutionPolicy PreferRemote -AllowOverrideItemsUpdates the workspace and resolves conflicts in favour of the remote branch.
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). |
| -AllowOverrideItems | switch | Named | – | Allows the update to override incoming items that conflict with workspace items. Default: False |
|
| -Confirmalias: cf | switch | Named | – | Prompts you for confirmation before running the cmdlet. |
|
| -ConflictResolutionPolicy | string | 3 | – | How to resolve conflicts: PreferRemote or PreferWorkspace. When omitted, the update fails if there are conflicts. |
|
| -NoAutoResolve | switch | Named | – | Does not look up RemoteCommitHash and WorkspaceHead automatically. Default: False |
|
| -NoWait | switch | Named | – | Returns the long-running operation details instead of waiting for it to finish. Default: False |
|
| -RemoteCommitHash | string | 1 | – | The full SHA hash of the remote commit to update to. Looked up automatically when omitted. |
|
| -WhatIfalias: wi | switch | Named | – | Runs the command in a mode that only reports what would happen without performing the actions. |
|
| -WorkspaceHead | string | 2 | – | 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 }}
Notes
https://learn.microsoft.com/en-us/rest/api/fabric/core/git/update-from-git
Requires the workspace Contributor role or higher.
Author: Kamil Nowinski