diff options
| -rw-r--r-- | win-nvim.ps1 | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/win-nvim.ps1 b/win-nvim.ps1 index 2ca2509..1e208d7 100644 --- a/win-nvim.ps1 +++ b/win-nvim.ps1 @@ -1,3 +1,8 @@ +# Install Git (if not already present on the system) +if (!(Get-Command git -ErrorAction SilentlyContinue)) { + winget install Git.Git +} + # Install NeoVim with winget, if not already present on the system if (!(Get-Command nvim -ErrorAction SilentlyContinue)) { winget install Neovim.Neovim @@ -12,10 +17,10 @@ if (!(Test-Path $dotFilesRoot -PathType Container)) { # Link NeoVim configuration $localConfiguration = Join-Path $env:LOCALAPPDATA "nvim" -$dotfilesConfiguration = Join-Path $dotFilesRoot ".config" "nvim" +$dotfilesConfiguration = Join-Path (Join-Path $dotFilesRoot ".config") "nvim" if (!(Test-Path $localConfiguration -PathType Container)) { - Start-Process -FilePath "cmd.exe" -ArgumentList "/c mklink /D $localConfiguration $dotfilesConfiguration" -Verb runas + Start-Process -FilePath "cmd.exe" -ArgumentList "/c mklink /D `"$localConfiguration`" `"$dotfilesConfiguration`"" -Verb runas } # Clone Packer.nvim, if not already present on the system @@ -29,6 +34,11 @@ if (!(Test-Path $localPacker -PathType Container)) { # Set-ExecutionPolicy RemoteSigned # Then run the script by using this command in the same existing directory: # ./win-nvim.ps1 + +# To allow script execution, run the following command in PowerShell as an administrator: +# Set-ExecutionPolicy RemoteSigned +# Then run the script by using this command in the same existing directory: +# ./win-nvim.ps1 #curl -o winget-cli.appxbundle https://aka.ms/winget-cli-appxbundle #powershell Add-AppxPackage -Path "winget-cli.appxbundle" #Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) @@ -50,4 +60,3 @@ if (!(Test-Path $localPacker -PathType Container)) { #Unexpected token 'Refresh' in expression or statement. # + CategoryInfo : ParserError: (:) [], ParseException # + FullyQualifiedErrorId : MissingExpressionAfterOperator - |
