You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+74-12Lines changed: 74 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -163,10 +163,10 @@ This command is designed to take pipeline input and display it in a colorized fo
163
163
164
164
You can use a simple hashtable to define a color if the given property matches the hashtable key.
165
165
166
-

166
+

167
167
168
168
Or you can specify an ordered hashtable for more complex processing.
169
-

169
+

170
170
171
171
This command doesn't always work depending on the type of object you pipe to it. The problem appears to be related to the formatting system. Development and testing is ongoing.
172
172
@@ -178,22 +178,61 @@ This command will copy a PowerShell command, including parameters and help to a
178
178
179
179
A set of simple commands to make it easier to format values.
180
180
181
+
### [Format-Percent](docs/Format-Percent.md)
182
+
183
+
Treat a value as a percentage. This will write a [double] and not include the % sign.
This command will format a given numeric value. By default it will treat the number as an integer. Or you can specify a certain number of decimal places. The command will also allow you to format the value in KB, MB, etc.
@@ -229,7 +268,7 @@ This command provides a PowerShell alternative to the cmd.exe **MORE** command,
229
268
get-service | out-more
230
269
```
231
270
232
-

271
+

233
272
234
273
This also works in PowerShell Core.
235
274
@@ -243,11 +282,11 @@ Because this module is intended to make scripting easier for you, it adds option
243
282
244
283
In the PowerShell ISE, you will get a new menu under Add-Ons
245
284
246
-

285
+

247
286
248
287
You can use the menu or keyboard shortcut which will launch an input box.
249
288
250
-

289
+

251
290
252
291
The comment will be inserted at the current cursor location.
253
292
@@ -257,7 +296,7 @@ In VS Code, access the command palette (Ctrl+Shift+P) and then "PowerShell: Show
257
296
258
297
The primary command can be used to test a PowerShell expression or scriptblock for a specified number of times and calculate the average runtime, in milliseconds, over all the tests.
259
298
260
-
### Why?
299
+
### Why
261
300
262
301
When you run a single test with `Measure-Command` the result might be affected by any number of factors. Likewise, running multiple tests may also be influenced by things such as caching. The goal in this module is to provide a test framework where you can run a test repeatedly with either a static or random interval between each test. The results are aggregated and analyzed. Hopefully, this will provide a more meaningful or realistic result.
263
302
@@ -350,15 +389,15 @@ This function is a graphical replacement for `Read-Host`. It creates a simple WP
350
389
$name = Invoke-InputBox -Prompt "Enter a user name" -Title "New User Setup"
351
390
```
352
391
353
-

392
+

354
393
355
394
You can also capture a secure string.
356
395
357
396
```powershell
358
397
Invoke-Inputbox -Prompt "Enter a password for $Name" -AsSecureString -BackgroundColor red
359
398
```
360
399
361
-

400
+

362
401
363
402
This example also demonstrates that you can change form's background color. This function will **not** work in PowerShell Core.
@@ -726,7 +766,7 @@ Monday, March 4, 2019 1:00:00 PM
726
766
727
767
Convert a universal datetime to the local time.
728
768
729
-
### [Get-MyTimeInfo](./Get-MyTimeInfo.md)
769
+
### [Get-MyTimeInfo](docs/Get-MyTimeInfo.md)
730
770
731
771
Display a time settings for a collection of locations. This command is a PowerShell equivalent of a world clock. It will display a datetime value against a collection of locations. You can specify an ordered hashtable of locations and time zones. You can run command like:
732
772
@@ -752,8 +792,30 @@ Now Home Seattle New Zealand
752
792
753
793
This is a handy command when traveling and your laptop is using a locally derived time and you want to see the time in other locations. It is recommended that you set a PSDefaultParameter value for the HomeTimeZone parameter in your PowerShell profile.
754
794
795
+
## Console Utilities
796
+
797
+
### [Set-ConsoleTitle](docs/Set-ConsoleTitle.md)
798
+
799
+
Set the title bar of the current PowerShell console window.
VERBOSE: [10:33:17.0420820 BEGIN ] Starting Set-ConsoleTitle
804
+
VERBOSE: [10:33:17.0440568 PROCESS] Setting console title to Administrator: Desktop 5.1.17763.316
805
+
VERBOSE: Performing the operation "Set-ConsoleTitle" on target "Administrator: Desktop 5.1.17763.316".
806
+
VERBOSE: [10:33:17.0584056 END ] Ending Set-ConsoleTitle
807
+
```
808
+
809
+
### [Set-ConsoleColor](docs/Set-ConsoleColor.md)
810
+
811
+
Configure the foreground or background color of the current PowerShell console window. Note that if you are running the PSReadline module, this command won't work. You should use `Set-PSReadlineOption` or similar command to configure your session settings.
Where possible these commands have been tested with PowerShell Core, but not every platform. If you encounter problems, have suggestions or other feedback, please post an issue.
Copy file name to clipboardExpand all lines: docs/Get-MyVariable.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -83,6 +83,7 @@ c 8
83
83
VERBOSE: Finished getting my variables
84
84
8
85
85
```
86
+
86
87
This sample function dot sources the script with this function. Within the function, Get-MyVariable is called specifying scope 1, or the parent scope. Scope 0 would be the scope of the Get-MyVariable function. Here's the result.
This command will generate a custom file name based on a template string that you provide. You can create a template string using any of these variables. Most of these should be self-explanatory
Optimize the computernames in computers.txt and add a Computername property. Test each computer, ignoring those that fail, and get the Bits service on the ones that can be pinged.
93
+
Optimize the computer names in computers.txt and add a Computername property. Test each computer, ignoring those that fail, and get the Bits service on the ones that can be pinged.
0 commit comments