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
function Format-Json { | |
Param( | |
[Parameter(ValueFromPipeline=$True,Mandatory=$True)] | |
[string]$jsondata, | |
[int]$indent=2 | |
) | |
# Processing blocks are useful for multiline JSON strings | |
begin { $fullpipeline = "" } | |
process { $fullpipeline += $jsondata } | |
end { |
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
# Rudimentary implementation of *nix watch command for Powershell | |
# Tested under 2.0 and 5.1 | |
# Example usage: | |
# watch ls | |
# watch 'echo "Command with parameters"' | |
# watch -n 1 'echo "Display this every second"' | |
# watch -n 1 -command 'echo "Explicit use of the command parameter"' | |
function watch { | |
Param( |
NewerOlder