![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Commenting out a block What is the method for commenting out a block? /* .. */ doesn't work for me. Thanks. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Commenting out a block Sadly no. Please suggest this. The way I do it is if (0) { ............. .............. } -- Jeffrey Snover [MSFT] Windows PowerShell Architect Microsoft Corporation This posting is provided "AS IS" with no warranties, no confers rights. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Commenting out a block Thanks. Does the stuff between the { } have to be syntatically correct (other than matching {}'s) since this is a script and not compiled? "Jeffrey Snover [MSFT]" wrote: > Sadly no. Please suggest this. > The way I do it is > if (0) { > ............ > ............. > } > > -- > Jeffrey Snover [MSFT] > Windows PowerShell Architect > Microsoft Corporation > This posting is provided "AS IS" with no warranties, no confers rights. > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Commenting out a block > Thanks. Does the stuff between the { } have to be syntatically correct > (other > than matching {}'s) since this is a script and not compiled? Right - that is the downside of that technique - it has to be syntatically correct. Here is what you want to use: $IWishPowerShellHadBlockComments = @' ..... ..... '@ You can put anything in a here string. -- Jeffrey Snover [MSFT] Windows PowerShell Architect Microsoft Corporation This posting is provided "AS IS" with no warranties, no confers rights. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Commenting out a block "Jeffrey Snover [MSFT]" <jsnover@ntdev.microsoft.com> wrote in message news:206EEC8A-C24B-450F-BC7E-1E8FBFCD0526@microsoft.com... >> Thanks. Does the stuff between the { } have to be syntatically correct >> (other >> than matching {}'s) since this is a script and not compiled? > Right - that is the downside of that technique - it has to be syntatically > correct. Here is what you want to use: > > $IWishPowerShellHadBlockComments = @' > .... > .... > '@ Watch out and make sure there is no whitespace after the initial @'. -- Keith |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Commenting out a block Or use an IDE like Powershell Analyzer that had VS.NET like comment ability (one of my favorite features... that is auto outline!!!) "Keith Hill [MVP]" <r_keith_hill@no.spam.thank.u.hotmail.com> wrote in message news:eB2MK4sKHHA.4384@TK2MSFTNGP03.phx.gbl... > "Jeffrey Snover [MSFT]" <jsnover@ntdev.microsoft.com> wrote in message > news:206EEC8A-C24B-450F-BC7E-1E8FBFCD0526@microsoft.com... >>> Thanks. Does the stuff between the { } have to be syntatically correct >>> (other >>> than matching {}'s) since this is a script and not compiled? >> Right - that is the downside of that technique - it has to be >> syntatically correct. Here is what you want to use: >> >> $IWishPowerShellHadBlockComments = @' >> .... >> .... >> '@ > > Watch out and make sure there is no whitespace after the initial @'. > > -- > Keith > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| commenting multiline pipelines | PowerShell | |||
| block IE7 | Vista security | |||
| Re: Another BETTER Ultimate on the block! | Vista General | |||
| XPS PRinting and Commenting Similar to PDF Abilities | Vista print fax & scan | |||
| commenting lines | PowerShell | |||