SOLVED
Home

Import-Csv issue

%3CLINGO-SUB%20id%3D%22lingo-sub-333924%22%20slang%3D%22en-US%22%3EImport-Csv%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-333924%22%20slang%3D%22en-US%22%3E%3CPRE%3E%24info%20%3D%20Import-Csv%20-Path%20C%3A%5CUsers%5Czach-surface-pro%5CDownloads%5Cccl.csv%20-Delimiter%20%22.%22%3CBR%20%2F%3EForEach%20(%24item%20in%20%24info)%20%7B%3CBR%20%2F%3ESet-Team%20-GroupId%20%24item.GroupId%20-Description%20%24item.DefaultContact%20%2B%20%22%60n%22%20%2B%20%24item.Email%20%2B%20%22%60n%22%20%2B%20%24item.Phone%20%2B%20%22%60n%22%20%2B%20%24item.Address1%20%2B%20%24item.City%20%2B%20%24item.State%20%2B%20%24item.Zip%20%2B%20%22%60n%22%20%2B%20%24item.AdditionalInfo%3CBR%20%2F%3E%7D%3C%2FPRE%3E%3CP%3E%26nbsp%3BHere%20is%20the%20error%3A%3C%2FP%3E%3CPRE%3ESet-Team%20%3A%20Cannot%20bind%20argument%20to%20parameter%20'GroupId'%20because%20it%20is%20null.%3CBR%20%2F%3EAt%20C%3A%5CUsers%5Czach-surface-pro%5COneDrive%20-%20Issaquah%20Bookkeeping%20and%20Accounting%20Services%5CScripts%5CSet%20team%20channel%20description%20contact%20info.ps1%3A3%20char%3A23%3CBR%20%2F%3E%2B%20Set-Team%20-GroupId%20%24item.GroupId%20-Description%20%24item.DefaultContact%20...%3CBR%20%2F%3E%2B%20~~~~~~~~~~~~~%3CBR%20%2F%3E%2B%20CategoryInfo%20%3A%20InvalidData%3A%20(%3A)%20%5BSet-Team%5D%2C%20ParameterBindingValidationException%3CBR%20%2F%3E%2B%20FullyQualifiedErrorId%20%3A%20ParameterArgumentValidationErrorNullNotAllowed%2CMicrosoft.TeamsCmdlets.PowerShell.Custom.SetTeam%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat's%20wrong%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-333924%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMicrosoft%20Teams%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-352180%22%20slang%3D%22en-US%22%3ERe%3A%20Import-Csv%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-352180%22%20slang%3D%22en-US%22%3EIn%20the%20end...%20I%20decided%20to%20import%20from%20txt%20with%20tab%20as%20a%20delimiter.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-334755%22%20slang%3D%22en-US%22%3ERe%3A%20Import-Csv%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-334755%22%20slang%3D%22en-US%22%3E%3CP%3EWhere%20did%20it%20come%20from%3F%20If%20you%20open%20it%20in%20notepad%20can%20you%20see%20some%20missing%20values%3F%20is%20there%20really%20a%20column%20called%20GroupID%20%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-334577%22%20slang%3D%22en-US%22%3ERe%3A%20Import-Csv%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-334577%22%20slang%3D%22en-US%22%3ESo...%20What%20do%20I%20do%20about%20it%3F%3CBR%20%2F%3EI%20tried%20finding%20an%20answer%20online%3B%20couldn't%20find%20anything.%3CBR%20%2F%3EThanks%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-333932%22%20slang%3D%22en-US%22%3ERe%3A%20Import-Csv%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-333932%22%20slang%3D%22en-US%22%3E%3CP%3EThere's%20a%20null%20in%20your%20csv%20file.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Zach_N
Occasional Contributor
$info = Import-Csv -Path C:\Users\zach-surface-pro\Downloads\ccl.csv -Delimiter "."
ForEach ($item in $info) {
Set-Team -GroupId $item.GroupId -Description $item.DefaultContact + "`n" + $item.Email + "`n" + $item.Phone + "`n" + $item.Address1 + $item.City + $item.State + $item.Zip + "`n" + $item.AdditionalInfo
}

 Here is the error:

Set-Team : Cannot bind argument to parameter 'GroupId' because it is null.
At C:\Users\zach-surface-pro\OneDrive - Issaquah Bookkeeping and Accounting Services\Scripts\Set team channel description contact info.ps1:3 char:23
+ Set-Team -GroupId $item.GroupId -Description $item.DefaultContact ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Set-Team], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.TeamsCmdlets.PowerShell.Custom.SetTeam

 

What's wrong?

 

Thanks

4 Replies
Solution

There's a null in your csv file.

So... What do I do about it?
I tried finding an answer online; couldn't find anything.
Thanks

Where did it come from? If you open it in notepad can you see some missing values? is there really a column called GroupID ?

 

In the end... I decided to import from txt with tab as a delimiter.
Related Conversations
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies
Tabs and Dark Mode
cjc2112 in Discussions on
2 Replies
Early preview of Microsoft Edge group policies
Sean Lyndersay in Discussions on
65 Replies
*Updated 9/3* Syncing in Microsoft Edge Preview Channels
Elliot Kirk in Articles on
202 Replies