Jelajahi Sumber

add get-internalip and windowsupdate

Tobias Simetsreiter 2 tahun lalu
induk
melakukan
a26a950664
2 mengubah file dengan 25 tambahan dan 0 penghapusan
  1. 10 0
      bin/Get-InternalIP.ps1
  2. 15 0
      bin/WindowsUpdate.ps1

+ 10 - 0
bin/Get-InternalIP.ps1

@@ -0,0 +1,10 @@
+
+Get-NetIPAddress | Where-Object { 
+    $_.IPAddress -like "10.*"
+} | ForEach-Object { 
+    @{ 
+        IP=$_.IPAddress;
+        Index=$_.InterfaceIndex
+        Adapter=(Get-NetIPInterface -InterfaceIndex $_.InterfaceIndex).InterfaceAlias
+    }
+}

+ 15 - 0
bin/WindowsUpdate.ps1

@@ -0,0 +1,15 @@
+
+
+foreach ($module in @("PSWindowsUpdate")){
+    if (-not (Get-Module -ListAvailable -Name $module)) {
+        Install-Module $module -Scope CurrentUser
+    }
+    if (-not (Get-Module $module)) {
+        Import-Module  $module
+    }
+}
+
+Get-WindowsUpdate
+# Get-WindowsUpdate -KBArticleID "KB4592449" -Install
+
+# Install-WindowsUpdate