使用电源Shell生成机器密钥 - 无法识别的命令 [英] Generate Machine Key using power Shell - Unrecognized Command

查看:216
本文介绍了使用电源Shell生成机器密钥 - 无法识别的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试生成一个机器密钥放在我的网络配置中,但它说它无法识别。我已经阅读了以下问题并使用相同的命令但没有成功生成机器密钥。请检查我在做什么:

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:

我拿了 Powershell脚本,然后执行以下命令:

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

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

然后

PS C:\> Generate-MachineKey -validationAlgorithm SHA1

它说:

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


推荐答案

尝试点源脚本的运行,在脚本之前放置一个句点然后放一个空格

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

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

这篇关于使用电源Shell生成机器密钥 - 无法识别的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆