Unicode support & different delimiters #10

Closed
opened 2020-08-07 14:18:39 +00:00 by pjrandewijk · 13 comments
pjrandewijk commented 2020-08-07 14:18:39 +00:00 (Migrated from github.com)

It would be nice if this script also support Unicode.

Import-Csv support both of these flags. It should be easy to pass them through from Add-TeamMembers to Import-Csv

It would be nice if this script also support Unicode. Import-Csv support both of these flags. It should be easy to pass them through from Add-TeamMembers to Import-Csv
github-actions[bot] commented 2020-08-07 16:18:45 +00:00 (Migrated from github.com)

Branch feature/issue-10 created!

Branch [feature/issue-10](https://github.com/luketainton/TeamsUserEnroller/tree/feature/issue-10) created!
luketainton commented 2020-08-07 16:25:09 +00:00 (Migrated from github.com)

Hi @pjrandewijk!

Would I be correct in assuming the flags you mean are -Delimiter and -Encoding?

Hi @pjrandewijk! Would I be correct in assuming the flags you mean are `-Delimiter` and `-Encoding`?
luketainton commented 2020-08-07 16:50:20 +00:00 (Migrated from github.com)
Version 2.2.0 is available at https://www.powershellgallery.com/packages/TeamsUserEnroller/2.2.0
pjrandewijk commented 2020-08-10 13:35:19 +00:00 (Migrated from github.com)

@luketainton Thank you very much. Sorry for the late reply. It seems my notifications is configured incorrectly. Yes, it is those two parameters you mentioned, are -Delimiter and -Encoding?

@luketainton Thank you very much. Sorry for the late reply. It seems my notifications is configured incorrectly. Yes, it is those two parameters you mentioned, are `-Delimiter` and `-Encoding?`
luketainton commented 2020-08-10 13:41:39 +00:00 (Migrated from github.com)

@pjrandewijk You're welcome 😄

Please let me know if you have any issues v2.2.0/v2.2.1 (which I released to include auto-updating), or if you have any more suggestions.

@pjrandewijk You're welcome 😄 Please let me know if you have any issues v2.2.0/v2.2.1 (which I released to include auto-updating), or if you have any more suggestions.
pjrandewijk commented 2020-08-10 15:42:00 +00:00 (Migrated from github.com)

How do you call the function?

Import-TeamsUsers -File C:\<path to csv file> -Encoding Unicode -Delimiter ";"

How do you call the function? `Import-TeamsUsers -File C:\<path to csv file> -Encoding Unicode -Delimiter ";"`
luketainton commented 2020-08-10 15:51:47 +00:00 (Migrated from github.com)

How do you call the function?

Try this:
Import-TeamsUsers -File C:\<path to csv file> -Encoding 'Unicode' -Delimiter ';'

I think the -Encoding flag takes a string literal so it might need to be wrapped in single quotes.

> How do you call the function? Try this: `Import-TeamsUsers -File C:\<path to csv file> -Encoding 'Unicode' -Delimiter ';'` I think the `-Encoding` flag takes a string literal so it might need to be wrapped in single quotes.
pjrandewijk commented 2020-08-10 15:54:25 +00:00 (Migrated from github.com)

I think I still maybe have the old version. How do I upgrade/update to the newer one. I get the following error message:

Import-TeamsUsers : A parameter cannot be found that matches parameter name 'Encoding'.
At line:1 char:64
+ ... sUsers -File C:\Users\petra\Downloads\62700-E20.csv -Encoding 'Unicod ...
+                                                         ~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Import-TeamsUsers], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Import-TeamsUsers
I think I still maybe have the old version. How do I upgrade/update to the newer one. I get the following error message: ``` Import-TeamsUsers : A parameter cannot be found that matches parameter name 'Encoding'. At line:1 char:64 + ... sUsers -File C:\Users\petra\Downloads\62700-E20.csv -Encoding 'Unicod ... + ~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Import-TeamsUsers], ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Import-TeamsUsers ```
luketainton commented 2020-08-10 15:56:18 +00:00 (Migrated from github.com)

Should be able to update with Update-Module -Name TeamsUserEnroller -RequiredVersion 2.2.1 -Force

Should be able to update with `Update-Module -Name TeamsUserEnroller -RequiredVersion 2.2.1 -Force`
pjrandewijk commented 2020-08-10 17:57:52 +00:00 (Migrated from github.com)

Hmmm, now I get:

WARNING: The version '1.1.4' of module 'MicrosoftTeams' is currently in use. Retry the operation after closing the
applications.

I have quit PowerShell and Quit Teams, but to no avail. There should be an easier way without rebooting though...

Hmmm, now I get: ``` WARNING: The version '1.1.4' of module 'MicrosoftTeams' is currently in use. Retry the operation after closing the applications. ``` I have quit PowerShell and Quit Teams, but to no avail. There should be an easier way without rebooting though...
luketainton commented 2020-08-10 20:02:38 +00:00 (Migrated from github.com)

This is usually because the module is loaded, so this might do the trick:

Remove-Module -Name TeamsUserEnroller
Remove-Module -Name MicrosoftTeams
Update-Module -Name TeamsUserEnroller -RequiredVersion 2.2.1 -Force
This is usually because the module is loaded, so this might do the trick: ```powershell Remove-Module -Name TeamsUserEnroller Remove-Module -Name MicrosoftTeams Update-Module -Name TeamsUserEnroller -RequiredVersion 2.2.1 -Force ```
pjrandewijk commented 2020-08-14 14:05:18 +00:00 (Migrated from github.com)

Hmmm, no joy.

Remove-Module : No modules were removed. Verify that the specification of modules to remove is correct and those
modules exist in the runspace.
At line:1 char:1
+ Remove-Module -Name TeamsUserEnroller
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Remove-Module], InvalidOperationException
    + FullyQualifiedErrorId : Modules_NoModulesRemoved,Microsoft.PowerShell.Commands.RemoveModuleCommand

PS C:\Users\petra> Remove-Module -Name MicrosoftTeams
Remove-Module : No modules were removed. Verify that the specification of modules to remove is correct and those
modules exist in the runspace.
At line:1 char:1
+ Remove-Module -Name MicrosoftTeams
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Remove-Module], InvalidOperationException
    + FullyQualifiedErrorId : Modules_NoModulesRemoved,Microsoft.PowerShell.Commands.RemoveModuleCommand

PS C:\Users\petra> Update-Module -Name TeamsUserEnroller -RequiredVersion 2.2.1 -Force
WARNING: The version '1.1.4' of module 'MicrosoftTeams' is currently in use. Retry the operation after closing the
applications.```

I can't install because MicrosoftTeams is in use. But I also cannot uninstall MicrosoftTeams.
Hmmm, no joy. ```PS C:\Users\petra> Remove-Module -Name TeamsUserEnroller Remove-Module : No modules were removed. Verify that the specification of modules to remove is correct and those modules exist in the runspace. At line:1 char:1 + Remove-Module -Name TeamsUserEnroller + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (:) [Remove-Module], InvalidOperationException + FullyQualifiedErrorId : Modules_NoModulesRemoved,Microsoft.PowerShell.Commands.RemoveModuleCommand PS C:\Users\petra> Remove-Module -Name MicrosoftTeams Remove-Module : No modules were removed. Verify that the specification of modules to remove is correct and those modules exist in the runspace. At line:1 char:1 + Remove-Module -Name MicrosoftTeams + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (:) [Remove-Module], InvalidOperationException + FullyQualifiedErrorId : Modules_NoModulesRemoved,Microsoft.PowerShell.Commands.RemoveModuleCommand PS C:\Users\petra> Update-Module -Name TeamsUserEnroller -RequiredVersion 2.2.1 -Force WARNING: The version '1.1.4' of module 'MicrosoftTeams' is currently in use. Retry the operation after closing the applications.``` I can't install because MicrosoftTeams is in use. But I also cannot uninstall MicrosoftTeams.
luketainton commented 2020-08-14 14:13:42 +00:00 (Migrated from github.com)

Maybe Remove -> Uninstall might work:

Uninstall-Module -Name TeamsUserEnroller
Uninstall-Module -Name MicrosoftTeams
Update-Module -Name TeamsUserEnroller -RequiredVersion 2.2.1 -Force
Maybe `Remove` -> `Uninstall` might work: ```powershell Uninstall-Module -Name TeamsUserEnroller Uninstall-Module -Name MicrosoftTeams Update-Module -Name TeamsUserEnroller -RequiredVersion 2.2.1 -Force ```
Sign in to join this conversation.