2
Vote

Issue with new-item command

description

Hi,

I am attempting to write to a firefox sqllite database "permissions.sqllite". The problem is that one of the names in the database fields is "type". When I attempt to write to the database with this command:

New-Item firefoxdb:\moz_hosts -host "www.test.com" -type "install"

I get the following error: "Parameter 'type' cannot be specified because it conflicts with the parameter alias of the same name for parameter 'ItemType'."

From what I can tell this is a built-in powershell parameter for the -itemtype alias that I cannot change.

If anyone has a way to get around this I would appreciate it.

comments

DavidSjostrand wrote Feb 14 at 12:25 PM

The following doesn't work either:
New-Item -Path firefoxdb:\moz_hosts -Value @{host="www.test.com"; type="install"}
New-Object psobject -property @{host="www.test.com"; type="install"} | New-Item -Path firefoxdb:\moz_hosts
I would also need a solution for this.