Use notepad $profile
to comment out the lines that are causing the issue in your PowerShell profile script and start a new session. If that solves the issue you can then further refine it.
You can disable a PowerShell module or un-install it using:
Remove-Module <ModuleName>
Uninstall-Module <ModuleName>
If disabling modules or removing the profile solves your issue, restart your powershell session.
If the above steps do not work, there may be an issue with the command itself.
Re-type the command to ensure there are no typos.
Attempt to use the IP address for the domain name in place of its name, there may be an issue with the resolving of DNS.
Install-ADDSForest -DomainName "10.1.1.1"
Use $PSVersionTable
to verify the PowerShell version.