diff --git a/docs/guide/extensions.md b/docs/guide/extensions.md index cfe5290c9..6e964416c 100644 --- a/docs/guide/extensions.md +++ b/docs/guide/extensions.md @@ -37,7 +37,7 @@ $psEditor.Workspace.OpenFile($profile) ```powershell # Insert new text replacing the user's current selection $context = $psEditor.GetEditorContext() -$context.InsertText("# All your script are belong to us", $context.SelectedRange) +$context.CurrentFile.InsertText("# All your script are belong to us", $context.SelectedRange) ``` #### Setting the selection based on the cursor position diff --git a/scripts/BuildDocs.ps1 b/scripts/BuildDocs.ps1 index 891861d07..02702dd8d 100644 --- a/scripts/BuildDocs.ps1 +++ b/scripts/BuildDocs.ps1 @@ -36,7 +36,9 @@ else { if ($Publish.IsPresent) { # Delete the existing docs repo folder - Remove-Item -Path $docsRepoPath -Recurse -Force -ErrorAction Stop | Out-Null + if (Test-Path $docsRepoPath) { + Remove-Item -Path $docsRepoPath -Recurse -Force -ErrorAction Stop | Out-Null + } # Clone the documentation site branch of the Editor Services repo git clone -b gh-pages https://github.com/PowerShell/PowerShellEditorServices.git $docsRepoPath