This file contains hidden or 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
| [CmdletBinding()] | |
| param( | |
| [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] | |
| [string[]]$ComputerNames = @($env:COMPUTERNAME), | |
| [string[]]$ScanPaths = @("D:\", "E:\"), | |
| [string]$OutputFile = "DNSUrls_$(Get-Date -Format 'yyyyMMdd_HHmmss').csv", | |
| [string]$LogFile = "ScanLog_$(Get-Date -Format 'yyyyMMdd_HHmmss').log", | |
| [string]$UrlPattern = '(?i)([a-z0-9-]+\.)+co\.nz', | |
| [int]$MaxConcurrentJobs = 5, | |
| [int]$BatchSize = 1000 |
This file contains hidden or 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
| # RemoteOps.Tests.ps1 | |
| BeforeAll { | |
| . $PSScriptRoot\RemoteOps.ps1 | |
| Mock Write-Log {} | |
| Mock Resolve-FullPath { $Path } | |
| Mock Get-Content { "Write-Output 'Test Script'" } | |
| } | |
| Describe "RemoteOps - Command Execution" { |
This file contains hidden or 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
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [string]$regPath, | |
| [Parameter(Mandatory=$true)] | |
| [string]$regName, | |
| [Parameter(Mandatory=$true)] | |
| [string]$regNewValue, |
This file contains hidden or 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
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$false)] | |
| [string]$regKeyPattern = '.*', | |
| [Parameter(Mandatory=$false)] | |
| [string]$regValuePattern = '.*', | |
| [Parameter(Mandatory=$false)] | |
| [string[]]$registryPaths = @("HKLM:\SOFTWARE\WOW6432Node\Google"), | |
| [Parameter(Mandatory=$false)] | |
| [string[]]$excludePaths = @("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Google\Update*"), |
This file contains hidden or 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
| <# | |
| .SYNOPSIS | |
| Executes commands or copies files on remote computers with enhanced features. | |
| .DESCRIPTION | |
| This script provides functionality to execute commands or copy files on multiple remote computers simultaneously. | |
| It supports both running commands/scripts and copying files/directories, with added features like retry logic, | |
| enhanced error handling, and more detailed logging. | |
| .PARAMETER ComputerName |
This file contains hidden or 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
| # Examples | |
| # | |
| # Run locally with dry-run mode | |
| #.\setRegValues.ps1 -csvFilePath ".\DNSPatternMatches.csv" -dryRun -Verbose | |
| # | |
| # Run locally | |
| #.\setRegValues.ps1 -csvFilePath ".\DNSPatternMatches.csv" | |
| # | |
| # Run remotely | |
| #.\setRegValues.ps1 -csvFilePath ".\DNSPatternMatches.csv" -computerNames "RemoteComputer1", "RemoteComputer2" |
This file contains hidden or 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
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$false)] | |
| [string]$matchPattern = "\.co\.nz", | |
| [Parameter(Mandatory=$false)] | |
| [string]$originalString = "dev", | |
| [Parameter(Mandatory=$false)] | |
| [string]$targetString = "dev2", |
This file contains hidden or 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
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$false)] | |
| [string]$dnsNamePattern = 'google', | |
| [Parameter(Mandatory=$false)] | |
| [string[]]$registryPaths = @("HKLM:\SOFTWARE\WOW6432Node\Google"), | |
| [Parameter(Mandatory=$false)] | |
| [string[]]$excludePaths = @("HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Google\Update*"), | |
| [Parameter(Mandatory=$false)] | |
| [string[]]$computerNames = @("localhost"), |
This file contains hidden or 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
| param( | |
| [Parameter(Mandatory=$false)] | |
| [string]$dnsServer, | |
| [Parameter(Mandatory=$false)] | |
| [string]$lookupZone, | |
| [Parameter(Mandatory=$false)] | |
| [string[]]$cnameRecords, |
This file contains hidden or 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
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$false)] | |
| [ValidateSet("Dev", "Prod")] | |
| [string]$Env = "Dev", | |
| [Parameter(Mandatory=$false)] | |
| [string]$dnsServer, | |
| [Parameter(Mandatory=$false)] |