Doug Maurer

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 699 total)
  • Author
    Posts
  • Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    Note even after changing the temp.com to test.com in Variable B data, only two entries from Variable A match entries from Variable B.

    in reply to: Get/convert size from exchange mailbox #285109
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    ToBytes() outputs just the numbers in the parenthesis. Exactly what you are asking for.

    in reply to: Get/convert size from exchange mailbox #285055
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    Take a closer look at the output of Get-Member

    Now if you inspect the value property

    Now we can simply use the ToBytes() method

    • This reply was modified 4 days, 18 hours ago by Doug Maurer.
    in reply to: Validate Script – Validate Custom Object Data Type #284623
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    First thing to know is every PSCustomObject property name is always a string. So really you should only be concerned with values. Here are some demonstrations

    Notice on the second example even though we tried to make it an int, it is a string and powershell had no issues forcing it to be a string.

    Now hashtable keys can be different types.

    in reply to: convert text to csv #282607
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    I’d say make it simple and easy on yourself by putting powershell to work for you.

    in reply to: Help copying a file #282496
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    Chances are there is more than one file. Regardless you can just pipe it into copy-item

    in reply to: Writing Powershell script output to EventData in Event log #282095
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    Lol thanks @Rob  it was the only way I could make it look nice with varying value lengths

    in reply to: Writing Powershell script output to EventData in Event log #281960
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    You should Format-Table outside of the Invoke-Command as it’s a formatting command. The data needs to be serialized and sent over and I’m fairly certain that breaks with the Format-* commands.

    in reply to: AzureADuser foreach question #281752
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    Only a base variable can be expanded in a string. Since you need to reference the samaccountname property surround it with a subexpression. So change

    “$user.samaccountname”

    to

    ”$($user.samaccountname)”

    in reply to: How do I get Outlook Appointments from Shared calendars #280275
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    If you run the script as admin then outlook needs to be run as admin. Have you tried my Export-OutlookSharedCalendar function?

    https://gist.github.com/krzydoug/f624cc7cec81fd006e1230907b74b446

    in reply to: formatting date time value #279840
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    You’re trying to extract hours, minutes, and seconds out of raw numbers. Do this instead

    in reply to: New to PS. Please help with Uninstall-Package #279837
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    It’s saying it can’t find the package when specifying the requiredversion (the only difference shown in your examples) so what if you try

    in reply to: A better way to get group count? #279831
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    Hmm I do see the numbers (how many members are in each group), with your code. Can you double check the code you’re running? $results.numberofmembers should be a list of numbers.

    in reply to: A better way to get group count? #279669
    Participant
    Topics: 9
    Replies: 701
    Points: 2,815
    Helping Hand
    Rank: Community Hero

    What do you mean you don’t get the counts enumerated? It seemed to work fine in my tests.

Viewing 15 posts - 1 through 15 (of 699 total)