Solved

Why is Set-Clutter import CSV erroring out?

Posted on 2016-11-07
3
28 Views
Last Modified: 2016-11-09
PS Import-CSV –Path E:\PowerShellScripts\CSVTemplates\Template-ClutterFalse.csv| ForEach-Object { Set-Clutter -UserPrincipalName $_.UserPrincipalName -Enable $_.Enable }

Cannot process argument transformation on parameter 'Enable'. Cannot convert value "System.String" to type "System.Nullable`1[System.Boolean]". Boolean parameters accept only Boolean values and numbers, such as
$True, $False, 1 or 0.
    + CategoryInfo          : InvalidData: (:) [Set-Clutter], ParameterBindin...mationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Set-Clutter
    + PSComputerName        : outlook.office365.com
0
Comment
Question by:Bart Opiola
  • 2
3 Comments
 

Author Comment

by:Bart Opiola
ID: 41877652
the CSV file has two columns: UserPrincipalName and Enable which are set to "email@domain.com" and "False" to turn clutter off
0
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 41877659
Assuming the other possible value for "Enable" in your csv is "True", try it like this:
Import-CSV –Path E:\PowerShellScripts\CSVTemplates\Template-ClutterFalse.csv |
	ForEach-Object {
		Set-Clutter -UserPrincipalName $_.UserPrincipalName -Enable ($_.Enable -eq 'True')
	}

Open in new window

1
 

Author Closing Comment

by:Bart Opiola
ID: 41877693
This works better - thanks!
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Utilizing an array to gracefully append to a list of EmailAddresses
The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now