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
When writing PowerShell commands, sometimes the culture you are running under becomes critical. For example, European countries use a different datetime format than North Americans which might present a problem with your script or command. Unless you have a separate computer running under the foreign culture, it is difficult to test. This command will allow you to test a scriptblock or even a file under a different culture, such as DE-DE for German.
This command will copy a PowerShell command, including parameters and help to a new user-specified command. You can use this to create a "wrapper" function or to easily create a proxy function. The default behavior is to create a copy of the command complete with the original comment-based help block.
@@ -897,12 +919,12 @@ $obj = [PSCustomObject]@{
897
919
Name = "Jeff"
898
920
Date = (Get-Date)
899
921
Computername = $env:computername
900
-
OS = (get-ciminstance win32_operatingsystem -Property Caption).caption
922
+
OS = (Get-CimInstance win32_operatingsystem -Property Caption).caption
@@ -948,6 +970,8 @@ OperatingSystem : Microsoft Windows 10 Pro
948
970
Runtime : 40.21:12:01
949
971
```
950
972
973
+
If you run this command within VS Code and specify `-Passthru`, the resulting file will be opened in your editor.
974
+
951
975
### [Write-Detail](docs/Write-Detail.md)
952
976
953
977
This command is designed to be used within your functions and scripts to make it easier to write a detailed message that you can use as verbose output. The assumption is that you are using an advanced function with a Begin, Process and End scriptblocks. You can create a detailed message to indicate what part of the code is being executed. The output can be configured to include a datetime stamp or just the time.
@@ -971,4 +995,4 @@ Begin {
971
995
972
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.
0 commit comments