{"id":5902,"date":"2013-03-27T13:57:57","date_gmt":"2013-03-27T21:57:57","guid":{"rendered":"http:\/\/www.sapien.com\/blog\/?p=5902"},"modified":"2013-03-28T09:22:32","modified_gmt":"2013-03-28T17:22:32","slug":"another-powershell-v3-breakpoint-bug","status":"publish","type":"post","link":"https:\/\/dev.sapien.com\/blog\/2013\/03\/27\/another-powershell-v3-breakpoint-bug\/","title":{"rendered":"Another PowerShell V3 breakpoint bug [UPDATED]"},"content":{"rendered":"<p>[UPDATE] Some users report that they cannot reproduce this behavior on Windows 8. Our Windows 8 machines show the same behavior. We will investigate further what the differences are.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/DisabledBreakpoint.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"DisabledBreakpoint\" style=\"border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline\" border=\"0\" alt=\"DisabledBreakpoint\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/DisabledBreakpoint_thumb.png\" width=\"560\" height=\"484\"><\/a> <\/p>\n<p>[END UPDATE]<\/p>\n<p>As we previously reported here (<a href=\"http:\/\/www.sapien.com\/blog\/2012\/09\/24\/powershell-v3-breakpoint-bug\/\" target=\"_blank\">PowerShell V3 breakpoint bug<\/a>) PowerShell V3 has a serious breakpoint bug where breakpoints cannot be set or removed after a script has been started.<\/p>\n<p>Our team has now discovered yet another breakpoint related bug in V3, which basically renders Disable-PSBreakpoint inoperative. It just doesn\u2019t work. Let me illustrate with the Microsoft Powershell V3 ISE under Windows 7 SP1.<\/p>\n<p>We open a simple four line script.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/SNAGHTML794f905.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"SNAGHTML794f905\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"SNAGHTML794f905\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/SNAGHTML794f905_thumb.png\" width=\"515\" height=\"484\"><\/a><\/p>\n<p>Yes, it has Write-Host in it, it doesn\u2019t matter. I set a breakpoint at line 15, as indicated by the coloring. Now we go and disable the breakpoints using this:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/image18.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/image_thumb11.png\" width=\"471\" height=\"102\"><\/a> <\/p>\n<\/p>\n<p>As you can see here, the ISE stops at the disabled breakpoint.<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/SNAGHTML7983fd5.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"SNAGHTML7983fd5\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"SNAGHTML7983fd5\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/SNAGHTML7983fd5_thumb.png\" width=\"515\" height=\"484\"><\/a><\/p>\n<p>Well, it could be that it\u2019s just the ISE that has a bug, so lets try another way. After closing the ISE, restarting it and loading the file again, we do this:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/SNAGHTML79c06bb.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"SNAGHTML79c06bb\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"SNAGHTML79c06bb\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/SNAGHTML79c06bb_thumb.png\" width=\"590\" height=\"484\"><\/a><\/p>\n<p>This time we use cmdlets to set and disable the breakpoint. The coloring in the file shown above changes accordingly as you execute the cmdlets.<\/p>\n<p>Now start the script:<\/p>\n<p><a href=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/SNAGHTML79d58e01.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" title=\"SNAGHTML79d58e0\" style=\"border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px\" border=\"0\" alt=\"SNAGHTML79d58e0\" src=\"http:\/\/www.sapien.com\/blog\/wp-content\/uploads\/2013\/03\/SNAGHTML79d58e0_thumb1.png\" width=\"590\" height=\"484\"><\/a><\/p>\n<p>Once again, PowerShell V3 stops at the disabled breakpoint. Using the V2 engine this does not happen and disable-psbreakpoint works as expected.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[UPDATE] Some users report that they cannot reproduce this behavior on Windows 8. Our Windows 8 machines show the same behavior. We will investigate further what the differences are. [END UPDATE] As we previously reported here (PowerShell V3 breakpoint bug) PowerShell V3 has a serious breakpoint bug where breakpoints cannot be set or removed after [&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":[25],"tags":[754,757,819,28,818,756],"class_list":["post-5902","post","type-post","status-publish","format-standard","hentry","category-windows-powershell","tag-breakpoint","tag-bug","tag-disable-psbreakpoint","tag-powershell","tag-set-psbreakpoint","tag-v3"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/5902","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=5902"}],"version-history":[{"count":4,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/5902\/revisions"}],"predecessor-version":[{"id":5910,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/posts\/5902\/revisions\/5910"}],"wp:attachment":[{"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/media?parent=5902"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/categories?post=5902"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dev.sapien.com\/blog\/wp-json\/wp\/v2\/tags?post=5902"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}