PowerShell

The PowerShell forum accepts bug reports as well as feedback and suggestions. For more information, check out the PowerShell Homepage

The following is a list of the states we use to track items.

status meaning
survey We saw this and we are considering it. Please upvote if it’s important to you.
needs more information We don’t understand the issue and need additional details.
investigating We are looking at this internally to understand things like: scenario, reproduction of issue, costing, or other technical details.
in queue The issue is understood and in our unprioritized backlog. Your votes will be used to drive prioritization of this work.

Please feel free to provide feedback or file bugs here.

(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback
  1. PSPossibleIncorrectComparisonWithNull - $null should be on the left side of equality comparisons.

    Votes from Connect: 3

    Original Date Submitted: 5/3/2015 6:39:12 PM

    Description:
    ********Contact Information********
    Handle: Remco Kapinga
    Site Name: PowerShell
    Feedback ID: 1299466
    ***************************************

    Problem Description:
    Invoke-ScriptAnalyzer flags this as a Warning:

    if ($item -ne $null) { .. }

    And suggest that we should write this comparison as:

    if ($null -ne $item) { .. }

    That makes code less readable (yoda-speak). This reminds us of the c language defect with if(a = null) { .. } versus if(a == null) { .. }

    I don't see the point of this rule in PowerShell, and the suggested construct makes code less readable.

    1 vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)

      We’ll send you updates on this idea

      0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
    • Variables that are $null are not always $null

      Votes from Connect: 3

      Original Date Submitted: 5/4/2015 1:20:27 AM

      Description:
      ********Contact Information********
      Handle: David I McIntosh
      Site Name: PowerShell
      Feedback ID: 1300430
      ***************************************

      Frequency: PowerShell
      Regression: >function emptyArray() { @() }
      >$l_t = @() ; $l_t.Count
      0
      >$l_t1 = @(); $l_t1 -eq $null; $l_t1.count; $l_t1.gettype()
      0
      IsPublic IsSerial Name BaseType
      -------- -------- ---- --------
      True True Object[] System.Array
      >$l_t += $l_t1; $l_t.Count
      0
      >$l_t += emptyArray; $l_t.Count
      0
      >$l_t2 = emptyArray; $l_t2 -eq $null; $l_t2.Count; $l_t2.gettype()
      True
      0
      You cannot call a method on a null-valued expression.
      At line:1 char:38
      + $l_t2 = emptyArray; $l_t2 -eq $null; $l_t2.Count; $l_t2.gettype() …

      1 vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)

        We’ll send you updates on this idea

        0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
      • Add -Wait and -Timeout parameters to Debug-Job

        Votes from Connect: 4

        Original Date Submitted: 10/6/2014 9:54:44 PM

        Description:
        ********Contact Information********
        Handle: Trevor Sullivan [MVP]
        Site Name: PowerShell
        Feedback ID: 993661
        ***************************************

        Frequency: Always Happens
        Regression: I don

        Problem Description:
        When writing a simple example to debug a PowerShell Background Job, the Background Job does not have enough time to initialize, before the Debug-Job command is invoked. Examine the following example:

        $ScriptBlock = {
        $Foo = 1;
        Wait-Debugger;
        $Foo++;
        };

        $Job = Start-Job -ScriptBlock $ScriptBlock;
        Debug-Job -Job $Job;

        When I run the above code in the PowerShell ISE, I receive an error message from Debug-Job, stating:

        "Debug-Job :…

        1 vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)

          We’ll send you updates on this idea

          0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
        • Install-WindowsFeature docs incomplete

          Votes from Connect: 28

          Original Date Submitted: 1/4/2014 6:13:19 AM

          Description:
          ********Contact Information********
          Handle: PowerShellDon
          Site Name: PowerShell
          Feedback ID: 812950
          ***************************************

          Frequency: Always Happens
          Regression: Yes, this happens in previous released versions

          Problem Description:
          Install-WindowsFeature is missing important instructions and caveats with regard to the -Source parameter.

          First, it does not provide examples of the correct path syntax when pointing to a WIM image (e.g., "wim:/c:/sources/install.wim:3", including an explanation of the numeric index). The help does suggest pointing to a WIM image, but without the right path syntax, it's hard to get it to actually work. The numeric index…

          1 vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)

            We’ll send you updates on this idea

            0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
          • CMDlet for Copying the last command to the clipboard.

            Votes from Connect: 10

            Original Date Submitted: 5/6/2015 6:05:20 AM

            Description:
            ********Contact Information********
            Handle: Dan Anstis, AUS
            Site Name: PowerShell
            Feedback ID: 1306453
            ***************************************

            Problem Description:
            It would be great if we could get a native CMDlet to copy the last command run into clipboard.
            I currently do this via a Copy-Last function in my profile, however it is so handy that I would love it to be included on all PowerShell consoles that I use.

            My function is as follows (for example of what I would like to see:

            function Copy-Last
            {
            (Get-History)[-1].CommandLine | clip
            }

            Product Studio item…

            1 vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)

              We’ll send you updates on this idea

              0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
            • Convert-VHD - please don't restrict it to Hyper-V role enabled

              Votes from Connect: 3

              Original Date Submitted: 10/24/2014 11:54:58 PM

              Description:
              ********Contact Information********
              Handle: FZB
              Site Name: PowerShell
              Feedback ID: 1010203
              ***************************************

              Frequency: Always Happens
              Regression: I don't know if this issue existed previously

              Problem Description:
              I am not sure if it's a Powershell issue or better suited for Windows Server, though without access to Windows Server connect, I'll try my luck here...
              Windows supports vhd/vhdx files, without the need of a hyper-v role. This in my point of view is a nice feature, which let's you for example create containers to nicely separate customer data per project, so if…

              1 vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)

                We’ll send you updates on this idea

                0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
              • Support disk cleanup command's feature in PowerShell cmdlet

                Votes from Connect: 12

                Original Date Submitted: 5/9/2015 1:38:47 PM

                Description:
                ********Contact Information********
                Handle: kkamegawa
                Site Name: PowerShell
                Feedback ID: 1316211
                ***************************************

                Problem Description:
                cleanmgr.exe do not install in Windows Server without desktop experience.
                But ServerCoreOS cannot support desktop experience.

                I hope to support PowerShell's cmdlet same as cleanmgr.exe's feature.

                Product Studio item created by Connect Synchronizer due to creation of feedback ID 1316211 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1316211).

                Repro Steps:

                Internal BugId: 14454

                1 vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)

                  We’ll send you updates on this idea

                  0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                • Update-Help shouldn't require running as admin

                  Votes from Connect: 12

                  Original Date Submitted: 3/12/2014 7:14:43 PM

                  Description:
                  ********Contact Information********
                  Handle: Stephen Owen
                  Site Name: PowerShell
                  Feedback ID: 832660
                  ***************************************

                  Frequency: Always Happens
                  Regression: Yes, this happens in all previous versions

                  Problem Description:
                  Hi all,

                  I think that it is a constant annoyance having to update-help on new servers or workstations. In my opinion, there is really no reason that Update-help should require me to relaunch Help as an admin user, as that requires launching a separate instance of the console.

                  THanks,

                  Product Studio item created by Connect Synchronizer due to creation of feedback ID 832660 (…

                  1 vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)

                    We’ll send you updates on this idea

                    0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                  • Need cmdlets to configure user rights and privileges

                    Votes from Connect: 5

                    Original Date Submitted: 10/29/2014 8:02:24 PM

                    Description:
                    ********Contact Information********
                    Handle: BigBadJogr
                    Site Name: PowerShell
                    Feedback ID: 1014489
                    ***************************************

                    Frequency: Sometimes Happens
                    Regression: Yes, this happens in previous released versions

                    Problem Description:
                    Configuring user/group rights and privileges from PowerShell is too complex.
                    There are a number of solutions that imply using 3rd party dlls, C#, ntrights.exe or secedit.exe, but I think this is a scenario that should be supported natively by PowerShell.
                    e.g.
                    Set-UserRight -userName localhost\MyUser -Right SeInteractiveLogonRight -Allow

                    Product Studio item created by Connect Synchronizer due to creation of feedback ID 1014489 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1014489).

                    Repro…

                    1 vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)

                      We’ll send you updates on this idea

                      0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                    • Get-Command's System.Management.Automation.AliasInfo object should return an 'IntroducedIn' Property

                      Votes from Connect: 5

                      Original Date Submitted: 10/29/2014 11:53:04 PM

                      Description:
                      ********Contact Information********
                      Handle: Stephen Owen
                      Site Name: PowerShell
                      Feedback ID: 1014669
                      ***************************************

                      Frequency: Always Happens
                      Regression: Yes, this happens in all previous versions

                      Problem Description:
                      Currently there is no easy method to determine which version of PowerShell a particular cmdlet will work within.

                      Take the example of New-PSDrive. This command was introduced in PowerShell version 2.0, but the current Version property displayed when I run 'Get-Command New-PSDrive | Format-List' displays the value of 3.1.

                      While this cmdlet was included in 3.0 and 4.0, it is misleading that the version…

                      1 vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)

                        We’ll send you updates on this idea

                        0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                      • Cannot build a binary module referencing 3.0 SMA.dll on Windows 10 without having to retarget to .NET 4.5

                        Votes from Connect: 5

                        Original Date Submitted: 9/21/2015 7:09:45 AM

                        Description:
                        ********Contact Information********
                        Handle: Keith Hill MVP
                        Site Name: PowerShell
                        Feedback ID: 1816181
                        ***************************************

                        Frequency: Other
                        Regression: Try to build a binary module on Windows 10 RTM with VS 2015. Reference the 3.0 SMA.dll reference assembly. This will fail to compile.

                        Problem Description:
                        When I try to build PSCX on Windows 10 - referencing System.Management.Automation.dll version 3.0 in the C:\Program Files (x86)\Reference Assemblies folder, I get a build error in VS 2015:

                        C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(1819,5): warning MSB3275: The primary reference "System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because…

                        1 vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)

                          We’ll send you updates on this idea

                          0 comments  ·  Documentation  ·  Flag idea as inappropriate…  ·  Admin →
                        • Update-DscConfiguration -Credential not working as expected

                          Votes from Connect: 3

                          Original Date Submitted: 9/25/2015 5:21:10 PM

                          Description:
                          ********Contact Information********
                          Handle: Jan Egil Ring
                          Site Name: PowerShell
                          Feedback ID: 1833443
                          ***************************************

                          Frequency: Desired State Configuration (DSC)
                          Regression: Update-DscConfiguration -ComputerName demohyper01 -Credential $TargetNodeCred -Wait -ErrorAction Stop

                          Problem Description:
                          Version: WMF 4 with 2014 November Update on Windows Server 2012 R2

                          I`ve run into access denied errors when using alternate credentials on Update-DscConfiguration:

                          PS C:\> Update-DscConfiguration -ComputerName demohyper01 -Credential $TargetNodeCred -Wait -ErrorAction Stop
                          VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = PerformRequiredConfigurationChecks,'className' = MSFT_DSCLocalConfigurationManager,'namesp
                          aceName' = root/Microsoft/Windows/DesiredStateConfiguration'.
                          VERBOSE: An LCM method call arrived from computer DEMORD01 with…

                          1 vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)

                            We’ll send you updates on this idea

                            0 comments  ·  Desired State Configuration (DSC)  ·  Flag idea as inappropriate…  ·  Admin →
                          • Add-Type throws confusing error when directory path is passed into -Path parameter

                            Votes from Connect: 3

                            Original Date Submitted: 9/27/2015 4:02:47 AM

                            Description:
                            ********Contact Information********
                            Handle: Trevor Sullivan [MVP]
                            Site Name: PowerShell
                            Feedback ID: 1839152
                            ***************************************

                            Frequency: PowerShell
                            Regression: Add-Type -Path c:\temp;

                            Problem Description:
                            I accidentally pointed Add-Type -Path to a directory, instead of a file, and got a confusing error message. Due to the vague nature of the exception, it wasn't immediately clear to me that I had made an error with the parameter value I passed in. Can we get this clarified?

                            > Add-Type : Cannot add type. The "" extension is not supported.

                            Product Studio item created by Connect…

                            1 vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)

                              We’ll send you updates on this idea

                              0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                            • PS4.0: (Get-Variable MyInvocation -Scope 1).Value fails when powershell.exe run from MSBuild

                              Votes from Connect: 3

                              Original Date Submitted: 11/7/2014 10:07:44 PM

                              Description:

                              ********Contact Information********
                              Handle: sba
                              Site Name: PowerShell
                              Feedback ID: 1023770
                              ***************************************

                              Frequency: Always Happens
                              Regression: No, this is new to the most recent version

                              Problem Description:
                              I have a script that contains the following code:

                              --------------8<----------------
                              function Get-ScriptDirectory{

                              $Invocation = (Get-Variable MyInvocation -Scope 1).Value
                              try {
                              Split-Path $Invocation.MyCommand.Path -ea 0
                              }
                              catch {
                              Write-Warning 'You need to call this function from within a saved script.'
                              }
                              }

                              $scriptdir = Get-ScriptDirectory

                              Set-Location $scriptdir -ErrorAction Stop
                              --------------8<----------------

                              (this originates from PS2.0 days)

                              The script runs fine, except if it's run from…

                              1 vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)

                                We’ll send you updates on this idea

                                0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                              • PowerShell.exe -NonInteractive still prompts user with Out-GridView

                                Votes from Connect: 4

                                Original Date Submitted: 9/28/2015 2:16:15 AM

                                Description:
                                ********Contact Information********
                                Handle: Trevor Sullivan [MVP]
                                Site Name: PowerShell
                                Feedback ID: 1842431
                                ***************************************

                                Frequency: PowerShell
                                Regression: powershell.exe -NonInteractive -Command gps | ogv -PassThru

                                Problem Description:
                                PowerShell.exe -NonInteractive still prompts user with Out-GridView

                                Product Studio item created by Connect Synchronizer due to creation of feedback ID 1842431 (http://connect.microsoft.com/PowerShell/feedback/ViewFeedback.aspx?FeedbackID=1842431).

                                Repro Steps:
                                powershell.exe -NonInteractive -Command gps | ogv -PassThru

                                Expected Results:
                                Out-GridView should throw similar exception to Read-Host:

                                "read-host : Windows PowerShell is in NonInteractive mode. Read and Prompt functionality is not available."

                                Internal BugId: 15852

                                1 vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)

                                  We’ll send you updates on this idea

                                  0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                • SCVMM and SCDPM PowerShell Modules can't work together

                                  Votes from Connect: 13

                                  Original Date Submitted: 5/14/2014 10:32:59 PM

                                  Description:
                                  ********Contact Information********
                                  Handle: Мухаметшин Наиль
                                  Site Name: PowerShell
                                  Feedback ID: 873348
                                  ***************************************

                                  Frequency: Always Happens
                                  Regression: Yes, this happens in previous released versions

                                  Problem Description:
                                  Good day everyone!

                                  Very strange issue: when i try to load together Virtual Machine Manager 2012 and Data Protection Manager 2012 modules - script fails:

                                  PS C:\Windows\system32> ipmo virtualmachinemanager
                                  PS C:\Windows\system32> ipmo DataProtectionManager
                                  Import-Module : Could not load type 'Microsoft.Internal.EnterpriseStorage.Dls.Utils.AlertTypes.AlertEnum' from assembly
                                  'Utils, Version=1.0.523.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
                                  At C:\Program Files\Microsoft System Center 2012 R2\DPM\DPM\bin\Modules\DataProtectionManager\DataProtectionManager.psm
                                  1:2 char:1
                                  + Import-Module (Join-Path $cmdletDllPath ObjectModelCmdlet.dll)
                                  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                  + CategoryInfo…

                                  1 vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)

                                    We’ll send you updates on this idea

                                    0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                                  • Azure module conflict with Storage module

                                    Votes from Connect: 11

                                    Original Date Submitted: 6/5/2014 4:37:24 AM

                                    Description:
                                    ********Contact Information********
                                    Handle: keseph
                                    Site Name: PowerShell
                                    Feedback ID: 888873
                                    ***************************************

                                    Frequency: Always Happens
                                    Regression: I do not know if this issue existed previously

                                    Problem Description:
                                    Using the latest versions of the Azure PowerShell module from the Web Platform Installer on an otherwise-clean image of Windows Server 2012 R2 Datacenter from the Azure Gallery, you cannot import the Storage module after importing the Azure module. You receive a long string of errors starting with:
                                    ---
                                    PS C:\> Import-Module Storage
                                    Import-Module : Cannot process Cmdlet Definition XML for the following…

                                    1 vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)

                                      We’ll send you updates on this idea

                                      0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                                    • Doubled double quotes in inline expressions within expandable strings

                                      Votes from Connect: 3

                                      Original Date Submitted: 6/23/2014 5:09:33 PM

                                      Description:
                                      ********Contact Information********
                                      Handle: Ivan Akcheurov
                                      Site Name: PowerShell
                                      Feedback ID: 903486
                                      ***************************************

                                      Frequency: Always Happens
                                      Regression: I do not know if this issue existed previously

                                      Problem Description:
                                      "Fancy string - Hor""ray"
                                      # outputs correctly (only one double quote): Fancy string - Hor"ray

                                      'Hor"ray'.Replace('"', '""')
                                      # outputs correctly (two double quotes): Hor""ray

                                      "Fancy string - $('Hor"ray'.Replace('"', '"'+'"'))"
                                      #outputs correctly (two double quotes): Hor""ray

                                      "Fancy string - $('Hor"ray'.Replace('"', '""'))"
                                      # outputs INCORRECTLY (only one double quote): Fancy string - Hor"ray

                                      In my opinion, developers would intuitively expect, that within "$(inline expressions)"…

                                      1 vote
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        I agree to the terms of service
                                        Signed in as (Sign out)

                                        We’ll send you updates on this idea

                                        0 comments  ·  Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
                                      • PowerShell copy on write behavior depends on operator type

                                        Votes from Connect: 3

                                        Original Date Submitted: 5/18/2015 2:02:46 AM

                                        Description:
                                        ********Contact Information********
                                        Handle: Sergey Teplyakov
                                        Site Name: PowerShell
                                        Feedback ID: 1341920
                                        ***************************************

                                        Frequency: PowerShell
                                        Regression:

                                        Problem Description:
                                        PowerShell uses copy-on-write semantic for inner scopes.

                                        This means that if you'll change outer variable in the inner scope then inner scope would deal with it's own copy. Here is an example:

                                        $list = @(1, 2)

                                        Function Foo
                                        {
                                        "Foo: initial value - $list"
                                        $list = $list + 3
                                        "Foo: `$list: $list, `$global:list: $global:list"
                                        }
                                        The output would be:

                                        Foo: initial value - 1 2
                                        Foo: $list: 1 2 3, $global:list: 1…

                                        1 vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          I agree to the terms of service
                                          Signed in as (Sign out)

                                          We’ll send you updates on this idea

                                          0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                        • Class constructor returns instance when exception is thrown

                                          Votes from Connect: 7

                                          Original Date Submitted: 5/19/2015 2:43:00 AM

                                          Description:
                                          ********Contact Information********
                                          Handle: Trevor Sullivan [MVP]
                                          Site Name: PowerShell
                                          Feedback ID: 1345058
                                          ***************************************

                                          Frequency: PowerShell
                                          Regression: class BaconStrip {
                                          [string] $Length;
                                          [string] $Width;

                                          [ValidateSet('Cooked', 'Raw')]
                                          [string] $Status;

                                          [ValidateSet('Regular', 'Applewood', 'Smoked')]
                                          [string] $Type;

                                          BaconStrip([string] $Type) {
                                          $this.Type = $Type;
                                          }

                                          [void] Cook() {
                                          $this.Status = 'Cooked';
                                          }
                                          }

                                          ### Create a new BaconStrip instance with an invalid type
                                          $MyBaconStrip = [BaconStrip]::new('Regular2');

                                          ### This variable should be $null if an exception is thrown in the constructor
                                          $MyBaconStrip;

                                          Problem Description:
                                          In April 2015 Preview of WMF 5.0 (version: 5.0.10105.0), when you construct…

                                          1 vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)

                                            We’ll send you updates on this idea

                                            0 comments  ·  PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
                                          • Don't see your idea?

                                          Feedback and Knowledge Base