For reasons, I need to use PowerShell to get information about the computer's IP. Therefore, I tried using System.Management.Automation along with NugetForUnity, but VS keeps saying that The type or namespace name 'Automation' does not exist in the namespace 'System.Management' (are you missing an assembly reference?) I know for a fact that I have installed the package, but I have not gotten anywhere with this project for the past 4 hours. Does anybody have any advice? Here is my code:
using System.Management.Automation;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class getLocation : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
//https://www.codeproject.com/Questions/1206308/Powershell-commands-from-Csharp
//Modified by @alex#6555
using (var ps = PowerShell.Create())
{
ps.AddCommand("curl");
ps.AddArgument("ipinfo.io");
}
}
// Update is called once per frame
void Update()
{
}
}
If anybody knows what to do, some pointers would be greatly appreciated.