I'm writing a quick Powershell script to import modules and update some default parameters on various machines. I'm running into an issue where in my script when I add $PSDefaultParameterValues to the $profile it changes to System.Management.Automation.DefaultParameterDictionary which then throws an error of not being recognized as the name of a cmdlet.
Here is the code in my ps1 script
Add-Content -Path $PROFILE -Value "$PSDefaultParameterValues = @{}"
Here is what gets added to the profile
System.Management.Automation.DefaultParameterDictionary = @{}
I've tried everything from using Set-Content to using variables to avoid quotation confusion.
I appreciate the help!