不确定我是否应该使用Server Overflow ...在Azure上使用Django网站,通过GitHub进行部署...我在requirements.txt中有mysql-python甚至可以将site-packages添加到我的应用程序根目录...出现以下错误.
错误:需要Microsoft Visual C++ 9.0(无法找到vcvarsall.bat).从http://aka.ms/vcpython27获取它
在PowerShell v5中使用新的类函数,如果我们可以将方法放入类中,我正试图解决这个问题.
我已经尝试了以下并且玩了一下,但没有运气.
class Server {
[string]$computerName = "192.168.0.200"
[bool]$ping = (Test-Connection -ComputerName $computerName).count
}
$1 = [server]::new()
$1.computerName = "blah"
Run Code Online (Sandbox Code Playgroud)
我尝试通过设置属性手动输入计算机名称,但后来我假设你在创建对象时需要它
$1 = [server]::new($computerName = "192.168.0.200")
Run Code Online (Sandbox Code Playgroud)
我得到的例外情况是
[ERROR] Exception calling ".ctor" with "0" argument(s): "Cannot validate argument on parameter 'ComputerName'. The argument is null or empty. Provide an argument that is not null or empty, and then try the
[ERROR] command again."
[ERROR] At D:\Google Drive\Projects\VSPowerShell\DiscoveryFramework\DiscoveryFramework\DiscoveryFramework\class.ps1:12 char:1
[ERROR] + $1 = [server]::new()
[ERROR] + ~~~~~~~~~~~~~~~~~~~~
[ERROR] + CategoryInfo : …Run Code Online (Sandbox Code Playgroud)