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
+73-8Lines changed: 73 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ You can get the current release from this repository or install this from the Po
12
12
Install-Module PSScriptTools
13
13
```
14
14
15
-
or in PowerShell Core:
15
+
or in PowerShell 7:
16
16
17
17
```powershell
18
18
Install-Module PSScriptTools -scope CurrentUser
19
19
```
20
20
21
-
Starting in v2.2.0, the module was restructured to better support Desktop and Core editions. It is recommended that you uninstall any version older than 2.2.0 and then install the latest version from the PowerShell Gallery.
21
+
Starting in v2.2.0, the module was restructured to better support Desktop and Core editions. But starting with version 2.13.0, the module design has reverted. All commands will be exported. Anything that is platform specific should be handled on a per command basis. It is assumed you will be running this module in Windows PowerShell 5.1 or PowerShell 7.
22
22
23
23
```powershell
24
24
Uninstall-Module PSScriptTools -allversions
@@ -30,6 +30,38 @@ Please post any questions, problems or feedback in [Issues](https://github.com/j
When you use Get-WinEvent, the results are objects you can work with in PowerShell.
36
+
However, often times there is additional information that is part of the eventlog record, such as replacement strings, that are used to construct a message.
37
+
This additional information is not readily exposed.
38
+
You can use this command to convert results of a Get-WinEvent command into a PowerShell custom object with additional information.
This command is designed to accept pipelined output and create a markdown document. The pipeline output will formatted as a text block. You can optionally define a title, content to appear before the output and content to appear after the output. You can run a command like this:
366
+
This command is designed to accept pipelined output and create a markdown document. The pipeline output will formatted as a text block or a table You can optionally define a title, content to appear before the output and content to appear after the output. You can run a command like this:
@@ -352,7 +384,7 @@ which generates this markdown:
352
384
Running Winrm Windows Remote Management (WS-Manag...
353
385
```
354
386
355
-
_report 09/25/2018 09:57:12_
387
+
_report 09/25/2019 09:57:12_
356
388
```
357
389
358
390
Because the function writes markdown to the pipeline you will need to pipe it to a command `Out-File` to create a file.
@@ -566,7 +598,7 @@ Convert a hashtable object to a string equivalent that you can copy into your sc
566
598
This command will take an object and create a hashtable based on its properties. You can have the hashtable exclude some properties as well as properties that have no value.
This command will combine two hashtables into a single hashtable.Join-Hashtable will test for duplicate keys. If any of the keys from the first, or primary hashtable are found in the secondary hashtable, you will be prompted for which to keep. Or you can use -Force which will always keep the conflicting key from the first hashtable.
582
614
@@ -599,6 +631,39 @@ Computer HAL
599
631
Count 3
600
632
```
601
633
634
+
### [Rename-Hashtable](docs/Rename-HashTable.md)
635
+
636
+
This command allows you to rename a key in an existing hashtable or ordered dictionary object.
The hashtable in $h has Machinename property which can be renamed.
643
+
644
+
```powershell
645
+
PS C:\> Rename-HashTable -Name h -Key Machinename -NewKey Computername -Passthru
646
+
647
+
Name Value
648
+
---- -----
649
+
ServiceType Win32OwnProcess, InteractiveProcess
650
+
ServiceName Spooler
651
+
Container
652
+
CanPauseAndContinue False
653
+
RequiredServices {RPCSS, http}
654
+
ServicesDependedOn {RPCSS, http}
655
+
Computername .
656
+
CanStop True
657
+
StartType Automatic
658
+
Site
659
+
ServiceHandle SafeServiceHandle
660
+
DisplayName Print Spooler
661
+
CanShutdown False
662
+
Status Running
663
+
Name Spooler
664
+
DependentServices {Fax}
665
+
```
666
+
602
667
## Select Functions
603
668
604
669
The module contains 2 functions which simplify the use of `Select-Object`. The commands are intended to make it easier to select the first or last X number of objects. The commands include features so that you can sort the incoming objects on a given property first.
@@ -993,6 +1058,6 @@ Begin {
993
1058
994
1059
## Compatibility
995
1060
996
-
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.
1061
+
Where possible these commands have been tested with PowerShell 7, but not every platform. If you encounter problems, have suggestions or other feedback, please post an issue. It is assumed you will not be running this commands on any edition of PowerShell Core or any beta releases of PowerShell 7.
0 commit comments