powershell updates

This commit is contained in:
AJ ONeal
2020-06-30 19:15:31 +00:00
parent 6cb859eeff
commit 17924e670f
4 changed files with 19 additions and 16 deletions
+4 -3
View File
@@ -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
View File
@@ -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
View File
@@ -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"))
{
+4 -2
View File
@@ -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"
}