# 安装 force-link-environment

- 类型: Skill 技能
- 说明: Force-links a development or target environment to a Power Platform Pipelines host, overriding any existing association with a previous host. Use when creating a deploymentenvironments record fails with "this environment is already associated with another pipelines host", or when intentionally migrating an environment from one host to another (e.g., Platform Host → Custom Host, or between two Custom Hosts). Calls the documented `ManageEnvironmentStamp` Dataverse action (the API behind the "Force Link" button in the Deployment Pipeline Configuration app). DESTRUCTIVE to the previous host: makers lose access to any pipelines in that host that used this environment. Reversible by running Force Link from the previous host. Use when asked to: "force link environment", "force-link to new host", "switch pipelines host", "environment already associated with another host", "take over pipelines association", "relink environment to host".
- 仓库: https://github.com/microsoft/power-platform-skills

## 方式一 · 一键代装（复制提示词让 AI 代劳）

### Claude Code
```
请帮我安装 askskill 上的 "force-link-environment" 技能：
1. 下载 https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/force-link-environment/SKILL.md
2. 保存为 ~/.claude/skills/force-link-environment/SKILL.md
3. 装好后重载技能，告诉我可以用了
```

### Codex
```
请帮我安装 askskill 上的 "force-link-environment" 技能：
1. 下载 https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/force-link-environment/SKILL.md
2. 保存为 ~/.codex/skills/force-link-environment/SKILL.md
3. 装好后重载技能，告诉我可以用了
```

### Cursor
```
请帮我安装 askskill 上的 "force-link-environment" 技能：
1. 下载 https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/force-link-environment/SKILL.md
2. 保存为 ~/.cursor/skills/force-link-environment/SKILL.md
3. 装好后重载技能，告诉我可以用了
```

## 方式二 · 命令行安装（原生命令与配置）

### Claude Code
```bash
mkdir -p '~/.claude/skills/force-link-environment' && curl -fsSL 'https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/force-link-environment/SKILL.md' -o '~/.claude/skills/force-link-environment/SKILL.md'
```

### Codex
```bash
mkdir -p '~/.codex/skills/force-link-environment' && curl -fsSL 'https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/force-link-environment/SKILL.md' -o '~/.codex/skills/force-link-environment/SKILL.md'
```

### Cursor
```bash
mkdir -p '~/.cursor/skills/force-link-environment' && curl -fsSL 'https://raw.githubusercontent.com/microsoft/power-platform-skills/main/plugins/power-pages/skills/force-link-environment/SKILL.md' -o '~/.cursor/skills/force-link-environment/SKILL.md'
```
