Powershell code help

What's Hot
2»

Comments

  • Emp_FabEmp_Fab Frets: 24387
    edited November 2019
    @notanon ;; - I've edited it to remove the check for leading zeroes so it's good to go.  Just one last thing...  the final output $MyVar - is that a string variable or an integer ?  Reason being it needs to be used further on in the big script and I don't know if Powershell borks at a string when it's expecting an integer.
    Lack of planning on your part does not constitute an emergency on mine.
    Chips are "Plant-based" no matter how you cook them
    Donald Trump needs kicking out of a helicopter
    I'm personally responsible for all global warming
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • notanonnotanon Frets: 610
    @Emp_Fab No problem, my background is C based so I need the practice :-) . I've used different scripting languages but powershell is the strangest for me.

    It is returning a string but you can use the [int]::Parse method as used in the code above to return an integer (rename the function to something more apt and remove String).


    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
  • LoFiLoFi Frets: 534
    Purely as an aside, humans are terrible at coming up with random numbers. One of the issues is that we will deliberately avoid repeated digits far more than is statistically valid, so a lack of repeated digits in a series of numbers (or a long random number) is an indication that the number wasn't randomly generated.
    0reaction image LOL 0reaction image Wow! 0reaction image Wisdom
Sign In or Register to comment.