FabricTools v0.33.0 Public Preview

Initialize-FabricGitConnection

Initializes the Git connection of a Fabric workspace.

Syntax

Initialize-FabricGitConnection [-WorkspaceId] <guid> [[-InitializationStrategy] <string>] [-NoWait]
 [-WhatIf] [-Confirm] [<CommonParameters>]

Description

Initializes the Git connection of a workspace that is already connected to Git (state 'Connected'). This must be done once after connecting. The result tells you what to do next through requiredAction:

  • None: workspace and branch are in sync.
  • UpdateFromGit: run Invoke-FabricGitUpdate with the returned remoteCommitHash.
  • CommitToGit: run Invoke-FabricGitCommit to push the workspace content to the branch.

Use Connect-FabricGit -Initialize to connect and initialize in one call.

Examples

Example 1

Initialize-FabricGitConnection -WorkspaceId '11111111-1111-1111-1111-111111111111' -InitializationStrategy PreferRemote

Initializes the Git connection, preferring the content of the remote branch.

Parameters

NameTypeReq.Pos.PipelineDescription
-WorkspaceIdalias: Id guid ✓Required 0 By name

The ID of the workspace. Accepts pipeline input by property name (alias Id).

-Confirmalias: cf switch Named –

Prompts you for confirmation before running the cmdlet.

-InitializationStrategy string 1 –

What to do when both the workspace and the Git branch have content. None (default), PreferRemote or PreferWorkspace.

Default: None
-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.

This cmdlet also supports the common parameters, such as -Verbose and -ErrorAction. See about_CommonParameters.

Inputs

System.Guid

{{ Fill in the Description }}

Outputs

System.Management.Automation.PSCustomObject

Object with requiredAction

{{ Fill in the Description }}

System.Management.Automation.PSCustomObject

{{ Fill in the Description }}

Notes

https://learn.microsoft.com/en-us/rest/api/fabric/core/git/initialize-connection

Requires the workspace Admin role.

Author: Kamil Nowinski