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
- Add space between 'foreach' and the following parenthesis.
- Change the faulty 'a la' to the correct 'à la'.
- Write '.NET' and '.NET Framework' consistently the same throughout.
As described elsewhere in this guide, many folks in the community would dislike this approach for aesthetic reasons. However, this approach has the advantage of utilizing PowerShell's pipeline to "stream" the content in file.txt. Provided that the fictional "Do-Something" command isn't blocking the pipeline (a la Sort-Object), the shell can send lines of content (String objects, technically) through the pipeline in a continuous stream, rather than having to buffer them all into memory.
43
+
As described elsewhere in this guide, many folks in the community would dislike this approach for aesthetic reasons. However, this approach has the advantage of utilizing PowerShell's pipeline to "stream" the content in file.txt. Provided that the fictional "Do-Something" command isn't blocking the pipeline (à la Sort-Object), the shell can send lines of content (String objects, technically) through the pipeline in a continuous stream, rather than having to buffer them all into memory.
44
44
45
45
Some would argue that this second approach is always a poor one, and that if performance is an issue then you should devolve from a PowerShell-native approach into a lower-level .NET Framework approach:
46
46
@@ -73,8 +73,8 @@ The moral here is that both aesthetic and performance are important consideratio
73
73
74
74
This is just a rough guideline, but as a general rule:
75
75
76
-
1. Language features are faster than features of the .net framework
77
-
2. Compiled methods on objects and .net classes are still faster than script
76
+
1. Language features are faster than features of the .NET Framework
77
+
2. Compiled methods on objects and .NET classes are still faster than script
78
78
3. Simple PowerShell script is still faster than calling functions or cmdlets
79
79
80
80
It's counter-intuitive that script is faster than calling cmdlets that are compiled, but it's frequently true, unless there is a lot of work being done by each cmdlet. The overhead of calling cmdlets and passing data around is significant. Of course, this is just a guideline, and you should always **measure**.
0 commit comments