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
# Define parent folder | |
$Parent = "C:\temp\Parent" | |
# Search for text files recursively | |
$Files = Get-ChildItem -Path $Parent -Filter *.txt -Recurse | |
# Loop through files, moving to Parent folder | |
foreach ($File in $Files) | |
{ | |
Try |
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
$NetAdapterList = (gwmi -Query "SELECT * FROM Win32_NetworkAdapter") | |
$NetAdapterConfigList = (gwmi -Query "SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = 'True'") | |
$Results = @() | |
foreach ($NetAdapter in $NetAdapterList){ | |
$NetAdapterConfig = $NetAdapterConfigList | Where-Object { $_.Index -eq $NetAdapter.DeviceID } | |
If ($NetAdapterConfig -ne $null) | |
{ | |
$Object = New-Object PSCustomObject |
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 Use-Proxy { | |
$proxy = 'http://my.proxy.server:80/' | |
$WebRequest_params = @{ | |
Uri = 'http://www.example.com' | |
Method = 'Head' | |
DisableKeepAlive = $true | |
UseBasicParsing = $true | |
} | |
Try { |
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 Write-Log { | |
param( | |
$Message, | |
$logPath, | |
$Color = "Yellow" | |
) | |
Write-Host "$Message" -ForegroundColor $Color | |
If ($logPath -ne $null) | |
{ |
NewerOlder