timmcmic / DLConversionV2

MIT License
44 stars 9 forks source link

This seems wrong #48

Closed janz1961 closed 2 years ago

janz1961 commented 2 years ago

Start-DistributionListMigration kept crashing and then I found:

Set-Office365DL.ps1:59 [boolean]$functionReportToOriginator=$NULL

Assigning $NULL to a boolean? Nah. On my computer this resulted in an exception. I changed it to $false. I'm assuming that PowerShell used to treat $NULL as false (just as they do zero) and this is why this problem never surfaced before.

I'm not really experienced with collaborative development and don't know how I could submit this change. Or if changes by me would even be accepted. But, I can let you know it works now. I can finally migrate thos DL's.

timmcmic commented 2 years ago

Are you using powershell 7 or 5.x

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.> (980)-776-7465

Hours: Sunday – Wednesday 08:00 – 16:00 eastern time zone.

Manager: Tom Roughley @.**@.>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================


From: janz1961 @.> Sent: Thursday, April 28, 2022 1:47 PM To: timmcmic/DLConversionV2 @.> Cc: Subscribed @.***> Subject: [timmcmic/DLConversionV2] This seems wrong (Issue #48)

Start-DistributionListMigration kept crashing and then I found:

Set-Office365DL.ps1:59 [boolean]$functionReportToOriginator=$NULL

Assigning $NULL to a boolean? Nah. On my computer this resulted in an exception. I changed it to $false. I'm assuming that PowerShell used to treat $NULL as false (just as they do zero) and this is why this problem never surfaced before.

I'm not really experienced with collaborative development and don't know how I could submit this change. Or if changes by me would even be accepted. But, I can let you know it works now. I can finally migrate thos DL's.

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F48&data=05%7C01%7Ctimmcmic%40microsoft.com%7C3c3e9bcca37e4fb8472908da293f1cdc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637867648293249412%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=FKo60SPP7iqZHMsXp%2BVFDTaqa8%2BAbxb9nOe46hvyQFk%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6IA7PFLACCDEE3ELOTVHLFJVANCNFSM5UTILY6Q&data=05%7C01%7Ctimmcmic%40microsoft.com%7C3c3e9bcca37e4fb8472908da293f1cdc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637867648293249412%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=5rtkGTbgYrEyjnjeVyYu7FUiu7oiAO00j4wUcBFYXOg%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.***>

janz1961 commented 2 years ago

See below. Added the easiest way to reproduce the error.

PS C:\> get-host | Select-Object Version

Version
-------
5.1.14393.5066

PS C:\> [boolean]$functionReportToOriginator=$NULL
Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True,
$False, 1 or 0.
At line:1 char:1
+ [boolean]$functionReportToOriginator=$NULL
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : MetadataError: (:) [], ArgumentTransformationMetadataException
    + FullyQualifiedErrorId : RuntimeException
timmcmic commented 2 years ago

Cool! It’s wrong anyway but I was just curious why it was happening all of a sudden. I’ll get it fixed Sunday and post a new version.

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.> (980)-776-7465

Hours: Sunday – Wednesday 08:00 – 16:00 eastern time zone.

Manager: Tom Roughley @.**@.>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================


From: janz1961 @.> Sent: Friday, April 29, 2022 4:06 AM To: timmcmic/DLConversionV2 @.> Cc: Tim McMichael @.>; Comment @.> Subject: Re: [timmcmic/DLConversionV2] This seems wrong (Issue #48)

See below. Added the easiest way to reproduce the error.

PS C:> get-host | Select-Object Version

Version

5.1.14393.5066

PS C:> [boolean]$functionReportToOriginator=$NULL Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. At line:1 char:1

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F48%23issuecomment-1113001353&data=05%7C01%7Ctimmcmic%40microsoft.com%7Cfe2b397c8e964c0e018908da29b72286%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637868163781525623%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7Ghef7rlF48OgHA4jBAPjqkHhDsTAKIfvqTp8aoxhr8%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6MPNCR5A7QYA2NCOS3VHOJ7PANCNFSM5UTILY6Q&data=05%7C01%7Ctimmcmic%40microsoft.com%7Cfe2b397c8e964c0e018908da29b72286%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637868163781525623%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=K8%2F7jWpY8hUZF%2Bq5j5bt6U3nC0r8plqZhod1emoMxMI%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

janz1961 commented 2 years ago

Yeah, I didn’t imagine that such a comprehensive set of tooling was only use by me because everyone should have ran into it 😊

Maybe you can solve another puzzle for me. While debugging it frustrated the hell out of me that every time the commend exited the shell (and in case of the ISE, the ISE). Why is this and is there a way around it. My workaround was using the ISE and keeping a modified file in it (so it would ask if I wanted to save it). But this was not ideal.

Jan

From: timmcmic @.> Sent: Friday, 29 April 2022 12:49 To: timmcmic/DLConversionV2 @.> Cc: Jan van Zeggelaar @.>; Author @.> Subject: Re: [timmcmic/DLConversionV2] This seems wrong (Issue #48)

Cool! It’s wrong anyway but I was just curious why it was happening all of a sudden. I’ll get it fixed Sunday and post a new version.

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.mailto:***@***.******@***.***> (980)-776-7465

Hours: Sunday – Wednesday 08:00 – 16:00 eastern time zone.

Manager: Tom Roughley @.**@.mailto:***@***.******@***.***>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================


From: janz1961 @.<mailto:@.>> Sent: Friday, April 29, 2022 4:06 AM To: timmcmic/DLConversionV2 @.<mailto:@.>> Cc: Tim McMichael @.<mailto:@.>>; Comment @.<mailto:@.>> Subject: Re: [timmcmic/DLConversionV2] This seems wrong (Issue #48)

See below. Added the easiest way to reproduce the error.

PS C:> get-host | Select-Object Version

Version

5.1.14393.5066

PS C:> [boolean]$functionReportToOriginator=$NULL Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. At line:1 char:1

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F48%23issuecomment-1113001353&data=05%7C01%7Ctimmcmic%40microsoft.com%7Cfe2b397c8e964c0e018908da29b72286%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637868163781525623%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7Ghef7rlF48OgHA4jBAPjqkHhDsTAKIfvqTp8aoxhr8%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6MPNCR5A7QYA2NCOS3VHOJ7PANCNFSM5UTILY6Q&data=05%7C01%7Ctimmcmic%40microsoft.com%7Cfe2b397c8e964c0e018908da29b72286%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637868163781525623%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=K8%2F7jWpY8hUZF%2Bq5j5bt6U3nC0r8plqZhod1emoMxMI%3D&reserved=0. You are receiving this because you commented.Message ID: @.<mailto:@.>>

— Reply to this email directly, view it on GitHubhttps://github.com/timmcmic/DLConversionV2/issues/48#issuecomment-1113166885, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNPWFLD6LUKHGLUYYPSG63VHO5ARANCNFSM5UTILY6Q. You are receiving this because you authored the thread.Message ID: @.**@.>>

timmcmic commented 2 years ago

So – the exit is by design to support multi-threading and job exiting.

What you can do is this.

Open a command prompt (not powershell).

Type powershell.exe.

This opens powershell from within command.

When the exit is called it exits to command.

When you run powershell.exe again it remembers the commands you previously ran by up arrowing.

DO not use ise.

Tim

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.> (980)-776-7465

Hours: Sunday – Wednesday 08:00 – 16:00 eastern time zone.

Manager: Tom Roughley @.**@.>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================

From: janz1961 @.> Sent: Friday, April 29, 2022 10:12 AM To: timmcmic/DLConversionV2 @.> Cc: Tim McMichael @.>; Comment @.> Subject: Re: [timmcmic/DLConversionV2] This seems wrong (Issue #48)

Yeah, I didn’t imagine that such a comprehensive set of tooling was only use by me because everyone should have ran into it 😊

Maybe you can solve another puzzle for me. While debugging it frustrated the hell out of me that every time the commend exited the shell (and in case of the ISE, the ISE). Why is this and is there a way around it. My workaround was using the ISE and keeping a modified file in it (so it would ask if I wanted to save it). But this was not ideal.

Jan

From: timmcmic @.<mailto:@.>> Sent: Friday, 29 April 2022 12:49 To: timmcmic/DLConversionV2 @.<mailto:@.>> Cc: Jan van Zeggelaar @.<mailto:@.>>; Author @.<mailto:@.>> Subject: Re: [timmcmic/DLConversionV2] This seems wrong (Issue #48)

Cool! It’s wrong anyway but I was just curious why it was happening all of a sudden. I’ll get it fixed Sunday and post a new version.

============================== Timothy J. McMichael Senior Support Escalation Engineer @.**@.mailto:***@***.******@***.***<mailto:***@***.******@***.***%3cmailto:***@***.******@***.***>> (980)-776-7465

Hours: Sunday – Wednesday 08:00 – 16:00 eastern time zone.

Manager: Tom Roughley @.**@.mailto:***@***.******@***.***<mailto:***@***.******@***.***%3cmailto:***@***.******@***.***>>)

Premier Support - (800)-936-3100 Broad Commercial Support - (800)-936-4900

==============================


From: janz1961 @.<mailto:@.mailto:***@***.***%3cmailto:***@***.***>> Sent: Friday, April 29, 2022 4:06 AM To: timmcmic/DLConversionV2 @.<mailto:@.mailto:***@***.***%3cmailto:***@***.***>> Cc: Tim McMichael @.<mailto:@.mailto:***@***.***%3cmailto:***@***.***>>; Comment @.<mailto:@.mailto:***@***.***%3cmailto:***@***.***>> Subject: Re: [timmcmic/DLConversionV2] This seems wrong (Issue #48)

See below. Added the easiest way to reproduce the error.

PS C:> get-host | Select-Object Version

Version

5.1.14393.5066

PS C:> [boolean]$functionReportToOriginator=$NULL Cannot convert value "" to type "System.Boolean". Boolean parameters accept only Boolean values and numbers, such as $True, $False, 1 or 0. At line:1 char:1

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F48%23issuecomment-1113001353&data=05%7C01%7Ctimmcmic%40microsoft.com%7Cfe2b397c8e964c0e018908da29b72286%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637868163781525623%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=7Ghef7rlF48OgHA4jBAPjqkHhDsTAKIfvqTp8aoxhr8%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6MPNCR5A7QYA2NCOS3VHOJ7PANCNFSM5UTILY6Q&data=05%7C01%7Ctimmcmic%40microsoft.com%7Cfe2b397c8e964c0e018908da29b72286%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637868163781525623%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=K8%2F7jWpY8hUZF%2Bq5j5bt6U3nC0r8plqZhod1emoMxMI%3D&reserved=0. You are receiving this because you commented.Message ID: @.<mailto:@.mailto:***@***.***%3cmailto:***@***.***>>

— Reply to this email directly, view it on GitHubhttps://github.com/timmcmic/DLConversionV2/issues/48#issuecomment-1113166885, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABNPWFLD6LUKHGLUYYPSG63VHO5ARANCNFSM5UTILY6Q. You are receiving this because you authored the thread.Message ID: @.**@.mailto:***@***.******@***.***>>

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftimmcmic%2FDLConversionV2%2Fissues%2F48%23issuecomment-1113362237&data=05%7C01%7Ctimmcmic%40microsoft.com%7Cafd5e88b0661461e645708da29ea3673%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637868383157515395%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=VRdnlaho6fAZZmwpaBNeAb5udMN18aEviRep7fOkT1I%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAKGTN6MPO2EBCG4QG2MAQWTVHPU2TANCNFSM5UTILY6Q&data=05%7C01%7Ctimmcmic%40microsoft.com%7Cafd5e88b0661461e645708da29ea3673%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637868383157515395%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2WjEgjSrBAzZ3EORlTR4Pdx%2F5CMwMvyhu%2FQZ3KNcQ%2F4%3D&reserved=0. You are receiving this because you commented.Message ID: @.**@.>>

timmcmic commented 2 years ago

Fixed 2.5.20 and published today.