Mark Minasi's Tech Forum
Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
glenn faustino

Avatar / Picture

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 21
Reply with quote  #1 


I just want to share this document I created just in case anyone might need it. My repository in GitHub is a little bit unorganized since I just used it to store the scripts I created.

Here's the link:

https://github.com/GlennFaustino/PowerShell/blob/master/ScriptingBestPractice.ps1

 

If you have any comments or suggestions just reply to this thread so I can modify and improve it, thanks!


__________________

glenn
C:\> Get-Shell | Where {$_.PipeLine -Contains "Objects"}

 

0
cj_berlin

Avatar / Picture

Senior Member
Registered:
Posts: 431
Reply with quote  #2 
Quote:
Originally Posted by glenn faustino
If you have any comments or suggestions just reply to this thread so I can modify and improve it, thanks!


Sure. On Line 224, you correctly suggest using string expansion instead of string concatenation. However, the example

Write-Output "Computer $Computer BIOS Serial $Wmi.SerialNumber"
is not going to produce the expected results. It should be

Write-Output "Computer $Computer BIOS Serial $($Wmi.SerialNumber)"
which would at the same time demonstrate the true power of string expansion ;-)

Apart from that, a very nice writeup. Keep up the good work!

__________________
Evgenij Smirnov

MVP Cloud & Datacenter Management
My personal blog (German): http://www.it-pro-berlin.de/
My stuff on PSGallery: https://www.powershellgallery.com/profiles/it-pro-berlin.de/
0
glenn faustino

Avatar / Picture

New Friend (or an Old Friend who Built a New Account)
Registered:
Posts: 21
Reply with quote  #3 
Quote:
Originally Posted by cj_berlin


Sure. On Line 224, you correctly suggest using string expansion instead of string concatenation. However, the example
 Write-Output "Computer $Computer BIOS Serial $Wmi.SerialNumber" 
is not going to produce the expected results. It should be
 Write-Output "Computer $Computer BIOS Serial $($Wmi.SerialNumber)" 
which would at the same time demonstrate the true power of string expansion ;-)

Apart from that, a very nice writeup. Keep up the good work!


Fixed. Thanks!

__________________

glenn
C:\> Get-Shell | Where {$_.PipeLine -Contains "Objects"}

 

0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.