Solved

Why is Set-Clutter import CSV erroring out?

Posted on 2016-11-07
3
20 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
Synchronize a new Active Directory domain with an existing Office 365 tenant
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

20 Experts available now in Live!

Get 1:1 Help Now