PetSerAl

My feedback

  1. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    That is totally valid syntax:

    "hej", "hej2", "hej3". "Length"

  2. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  PowerShell » Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    / is placeholder for culture dependent separator.

    Get-Date -Format 'yyyy''/''MM''/''dd'

  3. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    It is not a bug, but it is how [double] work: https://ideone.com/uoSycC

    You should use [decimal] if you want precise decimal numbers.

  4. 7 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  PowerShell » Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    How do you propose PowerShell should recognize UTF-8 if file does not have BOM?

  5. 4 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    0x00000000ffffffff is [int] literal not [long]. Thus, when this [int] is sign-expanded to [long] it result in 0xffffffffffffffff [long] value.

  6. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    2 comments  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    I also do not see that bug

    "Hello `r`r`n World".Replace("World", "BUG")

    work fine for me.

  7. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  PowerShell » Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    New-TimeSpan does not see 2.5 or 2.7 in the first place. Conversion to integer is done by PowerShell before cmdlet is called.

  8. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    Where do you see a bug? It is totally expected behavior by me. -OutVariable variable contains all previous output, not only last item as -PipelineVariable, thus the difference.

  9. 4 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell » Documentation  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl supported this idea  · 
  10. 5 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    $PSDefaultParameterValues['Export-Csv:NoTypeInformation']=$true

    Is not enough for you?

  11. 2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl supported this idea  · 
  12. 15 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  PowerShell » ISE and tooling  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl supported this idea  · 
  13. 2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  2 comments  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    > Typically in programming languages
    PowerShell is not typical programming language, it is shell programming language. Loops (for, foreach, while, do, switch) do not create scope in PowerShell. And I think, that your proposal will break to much existing code, so it not worth it.

  14. 9 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl supported this idea  · 
  15. 2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  PowerShell » Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    >De-duplicating a collection, or aggregating similar items in a collection, can be done in linear time via hash sets or hash tables, respectively.

    Only if you can define hash function which correspond with PowerShell equality meaning. But that would be hard given equality in PowerShell is not commutative.

    01,'01'|group
    '01',01|group

  16. 16 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  14 comments  ·  PowerShell » Microsoft.PowerShell.* Modules  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    @Joel "Jaykul" Bennett
    Can I ask one last question? Is anything "wrong" left after this command?

    Remove-TypeData System.Array

    PetSerAl commented  · 

    >Why are you still arguing that it is not wrong?
    Define "wrong". For me "wrong" is when function does not do what it is documented to do. Does ConvertTo-Json documented to behave as CliXML serializer? Does it produce not well formed JSON? Does resulting JSON is not related with object being serialized?

    There are more than one choice how to serialize object to JSON, and always will be someone who expect that different choice will be chosen. Currently, I only see one "wrong" thing: ConvertTo-Json is not document choices which it made.

    PetSerAl commented  · 

    @Joel "Jaykul" Bennett
    I do not post any workaround, I only demonstrating that extended properties are not included in JSON if object is not wrapped in PSObject. And I do not think that behavior of ConvertTo-Json is wrong. BTW, do you have any problems besides Count extended property of the System.Array type? If it is your only problem, then my workaround would be `Remove-TypeData System.Array`. That will remove Count extended property (which is unnecessary since v3) from arrays and make them produce JSON which you wish even when wrapped in PSObject.

    PetSerAl commented  · 

    And ConvertTo-Json cares about extended properties only when it sees PSObject. So, it is simple rule: do not wrap your objects into PSObject if you do not want to see extended properties in JSON.

    $MyListUnwrapped=$MyList.PSObject.BaseObject
    # you still can use extended properties
    $MyListUnwrapped.ExtendedProperty
    # but them not in JSON now
    ConvertTo-Json $MyListUnwrapped

    PetSerAl commented  · 

    @Roman Kuzmin
    If object have know JSON representation (IEnumerable, IDictionary, String, etc.), then ConvertTo-Json cares only about extended properties:

    Add-Type -TypeDefinition @'
    public class MyList : System.Collections.Generic.List<int> {
    public string NonExtendedProperty { get; set; }
    }
    '@

    $MyList=New-Object MyList|Add-Member ExtendedProperty ExtendedValue -PassThru
    $MyList.NonExtendedProperty='NonExtendedValue'

    $MyList.AddRange([int[]](1..3))

    ConvertTo-Json $MyList

    And Count is extended property for arrays in PowerShell.

    PetSerAl commented  · 

    So, what is your proposal? Should extra properties on collection types just be ignored? Or should them be converted to JSON somehow else? Or should <code>Count</code> array alias property to be special exception? What JSON following command should produce?

    ConvertTo-Json (,(1..3)|Add-Member ExtraPropertyName ExtraPropertyValue -PassThru)

  17. 18 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  1 comment  ·  PowerShell » Documentation  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl supported this idea  · 
  18. 36 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    5 comments  ·  PowerShell » Other PowerShell  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl supported this idea  · 
  19. 2 votes
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  0 comments  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl supported this idea  · 
  20. 1 vote
    Sign in
    (thinking…)
    Sign in with: Facebook Google
    Signed in as (Sign out)

    We’ll send you updates on this idea

    survey  ·  6 comments  ·  PowerShell » PowerShell Engine  ·  Flag idea as inappropriate…  ·  Admin →
    PetSerAl commented  · 

    Just use strict mode and this properties will not be available for you.

← Previous 1 3 4 5

Feedback and Knowledge Base