<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106168/nrfutil-completion-install-powershell</link><description>When executing: 
 
 The output suggests adding this to $PROFILE 
 
 
 I did some debuging to find out why the tab-completion does not work. If I am not wrong the variable ${USERPROFILE} should be $env:USERPROFILE. At least on my system (Windows 11, PowerShell</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Dec 2023 14:30:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106168/nrfutil-completion-install-powershell" /><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/459958?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 14:30:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4df9abcf-0aa3-4eca-bde5-62631c11a346</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;A new version of &amp;quot;nrfutil-completion&amp;quot; has been released.&amp;nbsp;New release can be installed by running &amp;quot;nrfutil install completion&amp;quot;.&lt;br /&gt;&lt;br /&gt;You do not need to do anything since everything works as expected for you with your modifications. However, you might want to use official version.&lt;br /&gt;&lt;br /&gt;Regarding the fix for PowerShell, the output for $PROFILE now accesses the path to the home directory using associated environment variable ($env:USERPROFILE/$env:HOME). Previously, script assumed that environment variables were accessible as normal variables ($USERPROFILE/$HOME), but this is only valid for newer versions of PowerShell.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/459949?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 14:09:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4d05c276-a99d-4a04-93eb-05f2411248a8</guid><dc:creator>xigit</dc:creator><description>&lt;p&gt;Does that mean the fix will be in the next version of nrfutil?&lt;br /&gt;Or is my case a corner case and the variable access via $USERRPOFILE should work without the optional &amp;quot;env&amp;quot; context&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/459946?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 14:01:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3fc2a86-745c-40a4-964d-da2c2d379ee8</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Reported issue has been fixed.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458980?ContentTypeID=1</link><pubDate>Tue, 05 Dec 2023 13:34:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83054749-094a-47de-b40e-da71c7c7fb58</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;This issue likely arose from the change made in PowerShell related to the access to environment variables. The completion system was most probably developed using newer version of PowerShell which allows access to environment variables directly, which made &amp;quot;env&amp;quot; optional.&lt;br /&gt;It might be that you used older version of PowerShell although you have v7.4 installed on your system. You can check the actual version by running $PSVersionTable.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458394?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 19:03:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bac5afa-f76e-48ad-a2b1-8c5a30ee6dd1</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I was not able to reproduce this on Windows 10. I have made an internal inquiry. I will get back to you by the end of next week.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458300?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 13:07:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8dbca73c-bea1-431a-825b-9f5288981ae4</guid><dc:creator>xigit</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="powershell"&gt;This should be the output of:
nrfutil completion install powershell
------

# WARNING: nrfutil tab-completion may become slow because of Windows Defender
# From nrfutil completion install
if ( Test-Path -Path ${env:USERPROFILE}\.nrfutil\share\nrfutil-completion\scripts\powershell\setup.ps1 ) {
    . ${env:USERPROFILE}\.nrfutil\share\nrfutil-completion\scripts\powershell\setup.ps1
 }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458296?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 12:59:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30d69e7e-8e13-41d6-ac9b-ddbfa05a18d7</guid><dc:creator>xigit</dc:creator><description>&lt;p&gt;? The Variable $USERPROFILE does not exist therefore tab completions can not work because the script is not found.&lt;br /&gt;I just tested &amp;quot; echo&amp;nbsp;&lt;span&gt;&amp;nbsp;$USERPROFILE&amp;quot; on another Windows machine and it does not exist.&lt;br /&gt;I think the output of nrfutil is wrong and should be changed to :&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;$env:USERPROFILE&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458291?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 12:42:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20ae4eae-42c8-49f9-a10b-6d8cbfa952ac</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;When you run setup script, you installed nrfutil and its tools, as well as made $PROFILE file, and then you manually added first line shown previously in your $PROFILE file. Is this correct?&lt;br /&gt;&lt;br /&gt;Could you show with example how tab-completion works for you before and after adding $USERPROFILE line in $PROFILE file?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458284?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 12:25:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d402473-2a8d-4d8a-9ea3-ecb498631be1</guid><dc:creator>xigit</dc:creator><description>&lt;p&gt;I have a setup script.&lt;br /&gt;It&amp;#39;s the first thing that is created.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="powershell"&gt;# Check if the user&amp;#39;s PowerShell profile exists, and create it if it doesn&amp;#39;t
  if (!(Test-Path -Path $PROFILE)) {
    New-Item -ItemType File -Path $PROFILE -Force
    Write-Host &amp;quot;Created new profile&amp;quot;
  }
  else {
    Write-Host &amp;quot;PowerShell profile already exists&amp;quot;
  }

# Check if git the command is available, and install it if it isn&amp;#39;t
  if (!(Get-Command -Name git -ErrorAction SilentlyContinue)) {
    Write-Host &amp;quot;Git not found, installing...&amp;quot;
    winget install -e --id=Git.Git
  }
  else {
    Write-Host &amp;quot;Git already installed&amp;quot;
  }
# Check if the git user config exists, and create it if it doesn&amp;#39;t
  if (!(git config --get user.name)) {
    Write-Host &amp;quot;Git user.name not set, setting...&amp;quot;
    git config --global user.name &amp;quot;T&amp;quot;
    git config --global user.email &amp;quot;t@tabs.com&amp;quot;
  }

# Print the current git user config
  Write-Host &amp;quot;Git user: $(git config --get user.name)&amp;quot;
  Write-Host &amp;quot;Git email: $(git config --get user.email)&amp;quot;

# Test SSH connection to GitHub
$sshOutput = Invoke-Expression &amp;#39;ssh -T git@github.com&amp;#39;

# Check if the SSH connection was successful
if ($sshOutput -match &amp;#39;successfully authenticated&amp;#39;) {
  Write-Host &amp;#39;✅SSH connection to GitHub successful&amp;#39;
} else {
  Write-Host &amp;#39;SSH connection to GitHub failed&amp;#39;
  Write-Host $sshOutput
  Write-Host &amp;#39;Make sure your SSH key is added to your GitHub account&amp;#39;
}

# Check if github cli is intalled and install if not
if (!(Get-Command -Name gh -ErrorAction SilentlyContinue)) {
  Write-Host &amp;quot;GitHub CLI not found, installing...&amp;quot;
  winget install -e --id=GitHub.cli
}
else {
  Write-Host &amp;quot;GitHub CLI already installed&amp;quot;
  Write-Host &amp;quot;Checking if the completion script is installed...&amp;quot;
  if (!(Select-String -Path $PROFILE -Pattern &amp;quot;gh completion -s powershell&amp;quot;)) {
    Write-Host &amp;quot;GitHub CLI completion script not installed, installing...&amp;quot;
    # Append gh completion command to PowerShell profile
    $profilePath = $PROFILE
    Add-Content -Path $profilePath -Value &amp;quot;`nInvoke-Expression -Command `$(`gh completion -s powershell` | Out-String)&amp;quot;
    Write-Host &amp;quot;GitHub CLI completion script installed&amp;quot;
  }
  else {
    Write-Host &amp;quot;✅GitHub CLI completion script already installed&amp;quot;
  }
}

### CHOCOLATEY ###
# Check if chocolatey is installed and install if not
if (!(Get-Command -Name choco -ErrorAction SilentlyContinue)) {
  Write-Host &amp;quot;Chocolatey not found, installing...&amp;quot;
  winget install -e --id=Chocolatey.Chocolatey
}
else {
  Write-Host &amp;quot;✅Chocolatey already installed&amp;quot;
}

### POSH-GIT ###
# Check if posh-git is installed and install if not
if (!(Get-Module -ListAvailable -Name posh-git)) {
  Write-Host &amp;quot;posh-git not found, installing...&amp;quot;
  # (A) You&amp;#39;ve never installed posh-git from the PowerShell Gallery
  PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force
}
else {
  Write-Host &amp;quot;✅posh-git already installed&amp;quot;
}

### NORDIC SEMICONDUCTOR ###
# Check if nrfutil is installed and install if not
if (!(Get-Command -Name nrfutil -ErrorAction SilentlyContinue)) {
  Write-Host &amp;quot;nrfutil not found, installing...&amp;quot;
  winget install NordicSemiconductor.nrfutil
}
else {
  Write-Host &amp;quot;✅nrfutil already installed&amp;quot;
}

# Install nrfutil tools
nrfutil install device
nrfutil install completion
nrfutil install toolchain-manager

# Configure nrfutil completion
# Check if the nrfutil completion script is installed, and install it if it isn&amp;#39;t
if (!(Select-String -Path $PROFILE -Pattern &amp;quot;From nrfutil completion install&amp;quot;)) {
  Write-Host &amp;quot;⚠️ nrfutil completion script not installed&amp;quot;
  Write-Host &amp;quot;Follow the instructions below to install it:&amp;quot;
  nrfutil completion install powershell
  Write-Host &amp;quot;⚠️ Re-run this script after installing the completion script&amp;quot;
  exit
}
else {
  Write-Host &amp;quot;✅nrfutil completion script already installed&amp;quot;
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458282?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 12:21:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d09a7a15-d790-41b3-8c7b-e3db5bfb9e22</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;How was your $PROFILE file created?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458269?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 11:12:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f6ddd31-d095-4aee-8c28-88a48589420f</guid><dc:creator>xigit</dc:creator><description>&lt;p&gt;I shared my whole profile file yesterday, it&amp;#39;s the first line&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458268?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 11:11:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:472bccfc-05a8-4fbd-a420-200d48c5dc49</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I edited my last reply.&lt;/p&gt;
[quote user="dejans"]Could you show the places where you needed to add $USERPROFILE manually?[/quote]
&lt;p&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458266?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 11:08:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c843feec-624d-4d40-b103-95fe33add73b</guid><dc:creator>xigit</dc:creator><description>&lt;p&gt;echo $profile&lt;br /&gt;C:\Users\timur\OneDrive\Dokumente\PowerShell\Microsoft.PowerShell_profile.ps1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458265?ContentTypeID=1</link><pubDate>Thu, 30 Nov 2023 11:04:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:907af37b-067f-4ff6-8dd1-9f728d667bab</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="xigit"]This is my $PROFILE where I had to add the $USERPROFILE manualy.[/quote]
&lt;p&gt;Where is the location of your $PROFILE?&lt;br /&gt;&lt;br /&gt;Could you show the places where you needed to add $USERPROFILE manually?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458073?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 11:58:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f227caf-cbc7-4469-bbfe-e3fd4ee2178e</guid><dc:creator>xigit</dc:creator><description>&lt;p&gt;I am just opening a PowerShell Terminal.&lt;br /&gt;This opens in my $HOME directory, C:\Useres\myuser&lt;br /&gt;&lt;br /&gt;This also the location of .nrfutil&lt;br /&gt;I installed nrfutil with:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="powershell"&gt;winget install NordicSemiconductor.nrfutil

Get-Command -Name nrfutil

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     nrfutil.exe                                        0.0.0.0    C:\Users\timur\AppData\Local\Microsoft\WinGet\Packages\NordicSemiconductor.nrfutil_Microsoft.Winget.Source_8wekyb3d8bbwe\nrfutil.exe&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is my $PROFILE where I had to add the $USERPROFILE manualy.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="powershell"&gt;# Set USERPROFILE
$USERPROFILE = $env:USERPROFILE

Invoke-Expression -Command $(gh completion -s powershell | Out-String)
# Aliases
Set-Alias -Name ll -Value Get-ChildItem -Force

# Powershell Modules
Import-Module posh-git

Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete

# WARNING: nrfutil tab-completion may become slow because of Windows Defender
# From nrfutil completion install
if ( Test-Path -Path ${USERPROFILE}\.nrfutil\share\nrfutil-completion\scripts\powershell\setup.ps1 ) {
    . ${USERPROFILE}\.nrfutil\share\nrfutil-completion\scripts\powershell\setup.ps1
 }
else {
    Write-Host &amp;quot;⚠️ The nrfutil completion script does not exist.&amp;quot;
    exit
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfutil completion install powershell</title><link>https://devzone.nordicsemi.com/thread/458062?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 11:39:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0df4fe4-04cb-4595-9299-aa84376059b6</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Where are nrfutil and .nrfutil located on your system, and where do you execute command &amp;quot;nrfutil completion install powershell&amp;quot; from?&lt;/p&gt;
[quote user=""]f I am not wrong the variable&amp;nbsp;${USERPROFILE} should be&amp;nbsp;$env:USERPROFILE.&lt;br /&gt;At least on my system (Windows 11, PowerShell 7.4) that was the solution.[/quote]
&lt;p&gt;Could you provide more details about your solution?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>