{"id":2720,"date":"2011-03-22T15:18:59","date_gmt":"2011-03-22T23:18:59","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/2011\/03\/22\/feature-peek-primalscript-2011-debugging-with-arguments\/"},"modified":"2011-05-05T08:34:18","modified_gmt":"2011-05-05T16:34:18","slug":"feature-peek-primalscript-2011-debugging-with-arguments","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2011\/03\/22\/feature-peek-primalscript-2011-debugging-with-arguments\/","title":{"rendered":"Feature Peek PrimalScript 2011: Debugging with arguments"},"content":{"rendered":"<p>Many of the scripts you develop use command line arguments to specify data that needs to be passed to the script. In a production environment these parameters usually change for each invocation of a script.<\/p>\n<p>For debugging however most developers use a fixed set of test parameters for any given script, which allows you to easily reproduce the state you need for debugging a specific item.<\/p>\n<p>In the past that meant that for each script you had to manually set the parameters somewhere in a dialog box before debugging. It also meant that you somehow had to remember what the necessary parameters for a script where. If you are anything like me, that means a lot of Post-It notes on your desk.<\/p>\n<p>In PrimalScript 2011 you can store the debug parameters for each script within the script itself. Simply add a comment somewhere.<\/p>\n<p># %DebugArguments%=&quot;Kick the tires and light the fires&quot;<\/p>\n<p>or in VBScript<\/p>\n<p>&#8216;&#160; %DebugArguments%=&quot;That&#8217;s a negative, Ghost Rider&quot;<\/p>\n<p>The quotes are there to make this ONE single parameter, of course you can specify multiple parameters as well:<\/p>\n<p>%DebugArguments%=Servername Username password<\/p>\n<p>Anytime you press that debug button now these parameters get passed to your script. No more Post-It notes, no more remembering what the parameters are.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/03\/PoshDebugArgs.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"PoshDebugArgs\" border=\"0\" alt=\"PoshDebugArgs\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/03\/PoshDebugArgs_thumb.png\" width=\"244\" height=\"148\" \/><\/a><\/p>\n<p><em>(PowerShell debugger with preset arguments)<\/em><\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/03\/VBSDebugArgs.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" title=\"VBSDebugArgs\" border=\"0\" alt=\"VBSDebugArgs\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2011\/03\/VBSDebugArgs_thumb.png\" width=\"244\" height=\"148\" \/><\/a><\/p>\n<p><em>(VBScript debugger with preset arguments)<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many of the scripts you develop use command line arguments to specify data that needs to be passed to the script. In a production environment these parameters usually change for each invocation of a script. For debugging however most developers use a fixed set of test parameters for any given script, which allows you to [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[582,176,21,24,25],"tags":[625,193,28,37,996],"class_list":["post-2720","post","type-post","status-publish","format-standard","hentry","category-feature-peek","category-sneak-peeks-at-the-next-version-of-primalscript","category-software-news","category-vbscript","category-windows-powershell","tag-arguments","tag-debugger","tag-powershell","tag-primalscript","tag-vbscript"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2720","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/comments?post=2720"}],"version-history":[{"count":3,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2720\/revisions"}],"predecessor-version":[{"id":2722,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/2720\/revisions\/2722"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=2720"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=2720"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=2720"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}