mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-08-23 22:16:48 +00:00
powershell updates
This commit is contained in:
+4
-3
@@ -23,14 +23,15 @@ pushd .local\bin
|
||||
|
||||
# TODO SetStrictMode
|
||||
# TODO Test-Path variable:global:Env:WEBI_HOST ???
|
||||
IF(!($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "")) {
|
||||
IF($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "")
|
||||
{
|
||||
$Env:WEBI_HOST = "https://webinstall.dev"
|
||||
}
|
||||
|
||||
# Fetch webi.bat
|
||||
Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1.bat" -OutFile webi.bat
|
||||
Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1" -OutFile webi.ps1
|
||||
echo "$Env:WEBI_HOST/packages/_webi/webi.ps1"
|
||||
curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1.bat" -o webi.bat
|
||||
curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1" -o webi.ps1
|
||||
|
||||
popd
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ if (!(Test-Path -Path .local\tmp))
|
||||
|
||||
# TODO SetStrictMode
|
||||
# TODO Test-Path variable:global:Env:WEBI_HOST ???
|
||||
IF(!$Env:WEBI_HOST)
|
||||
IF($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "")
|
||||
{
|
||||
$Env:WEBI_HOST = "https://webinstall.dev"
|
||||
}
|
||||
|
||||
+10
-10
@@ -6,23 +6,23 @@
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE/.ssh"))
|
||||
{
|
||||
New-Item -Path "$Env:USERPROFILE/.ssh" -ItemType Directory
|
||||
& icacls "$Env:USERPROFILE/.ssh" /inheritance:r
|
||||
& icacls "$Env:USERPROFILE/.ssh" /grant:r "%username%":"(F)"
|
||||
#& icacls "$Env:USERPROFILE/.ssh" /inheritance:r
|
||||
#& icacls "$Env:USERPROFILE/.ssh" /grant:r "$Env:USERNAME":"(F)"
|
||||
}
|
||||
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/config"))
|
||||
{
|
||||
New-Item -Path "$Env:USERPROFILE/.ssh/config" -ItemType "file" -Value ""
|
||||
& icacls "$Env:USERPROFILE/.ssh/config" /inheritance:r
|
||||
& icacls "$Env:USERPROFILE/.ssh/config" /grant:r "%username%":"(F)"
|
||||
#& icacls "$Env:USERPROFILE/.ssh/config" /inheritance:r
|
||||
#& icacls "$Env:USERPROFILE/.ssh/config" /grant:r "$Env:USERNAME":"(F)"
|
||||
}
|
||||
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/authorized_keys"))
|
||||
{
|
||||
New-Item -Path "$Env:USERPROFILE/.ssh/authorized_keys" -ItemType "file" -Value ""
|
||||
& icacls "$Env:USERPROFILE/.ssh/authorized_keys" /inheritance:r
|
||||
& icacls "$Env:USERPROFILE/.ssh/authorized_keys" /grant:r "%username%":"(F)"
|
||||
}
|
||||
#if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/authorized_keys"))
|
||||
#{
|
||||
# New-Item -Path "$Env:USERPROFILE/.ssh/authorized_keys" -ItemType "file" -Value ""
|
||||
# #& icacls "$Env:USERPROFILE/.ssh/authorized_keys" /inheritance:r
|
||||
# #& icacls "$Env:USERPROFILE/.ssh/authorized_keys" /grant:r "$Env:USERNAME":"(F)"
|
||||
#}
|
||||
|
||||
if (!(Test-Path -Path "$Env:USERPROFILE/.ssh/id_rsa"))
|
||||
{
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
$ipv4 = curl.exe -sf https://api.ipify.org
|
||||
|
||||
IF(!($ipv4 -eq $null -or $ipv4 -eq "")) {
|
||||
IF(!($ipv4 -eq $null -or $ipv4 -eq ""))
|
||||
{
|
||||
echo "IPv4 (A) : $ipv4"
|
||||
}
|
||||
|
||||
$ipv6 = curl.exe -sf https://api6.ipify.org
|
||||
|
||||
IF(!($ipv6 -eq $null -or $ipv6 -eq "")) {
|
||||
IF(!($ipv6 -eq $null -or $ipv6 -eq ""))
|
||||
{
|
||||
echo "IPv6 (AAAA): $ipv6"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user