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
| # Work in progress! | |
| # Derived from http://stackoverflow.com/questions/25709398/set-location-of-special-folders-with-powershell | |
| <# | |
| .SYNOPSIS | |
| Sets a known folder's path using SHSetKnownFolderPath. | |
| .PARAMETER Folder | |
| The known folder whose path to set. | |
| .PARAMETER Path | |
| The path. |
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
| #requires -Version 2 | |
| $maximumRuntimeSeconds = 3 | |
| $process = Start-Process -FilePath powershell.exe -ArgumentList '-Command Start-Sleep -Seconds 4' -PassThru | |
| try | |
| { | |
| $process | Wait-Process -Timeout $maximumRuntimeSeconds -ErrorAction Stop | |
| Write-Warning -Message 'Process successfully completed within timeout.' |
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] | |
| $ComputerName, | |
| [int] | |
| $Port = 443 | |
| ) |