From e0ca1e039ab7bff98be0fe6cd4bf18100eb0122f Mon Sep 17 00:00:00 2001 From: dttb Date: Mon, 4 May 2026 13:10:59 +0300 Subject: [PATCH] =?UTF-8?q?snippet=20netbird-claude-install:=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=B2=D0=BE=D0=B4=20Public=E2=86=92Private?= =?UTF-8?q?=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=20WinRM,=20try/catch=20=D0=BD?= =?UTF-8?q?=D0=B0=20Set-Item=20WSMan?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- snippets/netbird-claude-install.ps1 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/snippets/netbird-claude-install.ps1 b/snippets/netbird-claude-install.ps1 index c3aeb76..4767340 100644 --- a/snippets/netbird-claude-install.ps1 +++ b/snippets/netbird-claude-install.ps1 @@ -84,13 +84,19 @@ Enable-NetFirewallRule -DisplayGroup "Remote Desktop" -ErrorAction SilentlyConti # ===== 6. WinRM + OpenSSH Server ===== Write-Host "[6/7] WinRM + OpenSSH Server..." +# Сначала перевести Public-сети в Private (иначе Set-Item WSMan ругается) +try { + Get-NetConnectionProfile -ErrorAction SilentlyContinue | ` + Where-Object { $_.NetworkCategory -eq 'Public' } | ` + Set-NetConnectionProfile -NetworkCategory Private -ErrorAction SilentlyContinue +} catch {} try { Enable-PSRemoting -Force -SkipNetworkProfileCheck | Out-Null } catch { - winrm quickconfig -force -q | Out-Null + try { winrm quickconfig -force -q | Out-Null } catch {} } -Set-Item WSMan:\localhost\Service\Auth\Basic -Value $true -Force -ErrorAction SilentlyContinue -Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value $true -Force -ErrorAction SilentlyContinue +try { Set-Item WSMan:\localhost\Service\Auth\Basic -Value $true -Force -ErrorAction SilentlyContinue } catch {} +try { Set-Item WSMan:\localhost\Service\AllowUnencrypted -Value $true -Force -ErrorAction SilentlyContinue } catch {} # LocalAccountTokenFilterPolicy — чтобы локальный admin claude мог в WinRM New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" ` -Name "LocalAccountTokenFilterPolicy" -Value 1 -PropertyType DWord -Force | Out-Null