Generate Machine Key using power Shell - Unrecognized Command

ⅰ亾dé卋堺 提交于 2019-12-08 09:06:53

问题


I am trying to generate a machine key to place in my web configs, but its saying it is not recognized. I have already read the following question and use the same commands without success Generate Machine Key. Please check what am i doing:

I took the Powershell Script from microsoft site, then executed the commands below:

PS C:\> C:\Users\myuser\Desktop\Docs\KeyGeneration\machinekey.ps1

Then

PS C:\> Generate-MachineKey -validationAlgorithm SHA1

It says that:

The term 'Generate-MachineKey' is not recognized as the name of a cmdlet, function, script file

回答1:


Try "dot sourcing" the running of the script, by placing a period and then a space before the script

PS C:> . C:\Users\myuser\Desktop\Docs\KeyGeneration\machinekey.ps1



来源:https://stackoverflow.com/questions/39576902/generate-machine-key-using-power-shell-unrecognized-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!