Skip to content

Commit f58c82b

Browse files
committed
Merge pull request #225 from PowerShell/daviwil/doc-fix
Fix #223: Wrong InsertText call in extension docs
2 parents 5abe544 + f847e2f commit f58c82b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/guide/extensions.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $psEditor.Workspace.OpenFile($profile)
3737
```powershell
3838
# Insert new text replacing the user's current selection
3939
$context = $psEditor.GetEditorContext()
40-
$context.InsertText("# All your script are belong to us", $context.SelectedRange)
40+
$context.CurrentFile.InsertText("# All your script are belong to us", $context.SelectedRange)
4141
```
4242

4343
#### Setting the selection based on the cursor position

scripts/BuildDocs.ps1

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ else {
3636

3737
if ($Publish.IsPresent) {
3838
# Delete the existing docs repo folder
39-
Remove-Item -Path $docsRepoPath -Recurse -Force -ErrorAction Stop | Out-Null
39+
if (Test-Path $docsRepoPath) {
40+
Remove-Item -Path $docsRepoPath -Recurse -Force -ErrorAction Stop | Out-Null
41+
}
4042

4143
# Clone the documentation site branch of the Editor Services repo
4244
git clone -b gh-pages https://github.com/PowerShell/PowerShellEditorServices.git $docsRepoPath

0 commit comments

Comments
 (0)