This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
''' | |
Utility functions for salt.cloud | |
''' | |
# Import python libs | |
import os | |
import sys | |
import codecs | |
import shutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-NetFirewallRule -Name "SMB445" -DisplayName "SMB445" -Protocol TCP -LocalPort 445 | |
New-NetFirewallRule -Name "WINRM5986" -DisplayName "WINRM5986" -Protocol TCP -LocalPort 5986 | |
Set-Item (dir wsman:\localhost\Listener\*\Port -Recurse).pspath 445 -Force | |
Restart-Service winrm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Find-ChildProcess { | |
param($ID=$PID) | |
$CustomColumnID = @{ | |
Name = 'Id' | |
Expression = { [Int[]]$_.ProcessID } | |
} | |
$result = Get-WmiObject -Class Win32_Process -Filter "ParentProcessID=$ID" | Select-Object -Property ProcessName, $CustomColumnID, CommandLine | |