Question: I'm working on a small C# program to uninstall and reinstall windows appxpackages.
I've used many of the powershell commands manually and they all work fine if ran via powershell however I would like to just make a button that runs the command without having to go look up the command then copy paste it into the prompt window. I've researched this method for a few days now and I've not found anything helpful. 
Everywhere I look other users have done something like this however while this will compile this will not do anything. Perhaps I am just not seeing something or perhaps not understanding something. Can anyone please help!

```
Powershell commands:
Get-AppxPackage *windowsstore* | Remove-AppxPackage
Get-AppxPackage *windowsstore* | Add-AppxPackage

```

.

```
using System.Management.Automation;

```

.

```
private void button_Click(object sender, EventArgs e)
{
    PowerShell ps = PowerShell.Create();
    ps.AddCommand("Get-AppxPackage");
    ps.AddArgument("*windowsstore*");
    ps.AddCommand("Remove-AppxPackage");
    ps.Invoke();
    Console.WriteLine("POWERSHELL OUTPUT! =( "+ps+" )");
}

```

Output:  

 POWERSHELL OUTPUT! =( System.Management.Automation.PowerShell )

Answer: 
As [@Gert Arnold](https://stackoverflow.com/users/861716/gert-arnold) Mentioned this is not "yet" possible .
Entity Framework 7 will support this Feature.

For those who want to be kept up to date, here is the Feature Discussion / Voting.

[Unique Constraint (i.e. Candidate Key) Support](http://data.uservoice.com/forums/72025-entity-framework-feature-suggestions/suggestions/1050579-unique-constraint-i-e-candidate-key-support)
As a workaround, would you be able to add both a ClientId and ClientNumber property? You can than access ClientNumber from the virtual Client property after ensuring that Client is not null:

```
    public class Client
    {
        public string Id { get; set; }
        public string Name { get; set; }
        public int Number { get; set; }
    }

    public class Department 
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string ClientId { get; set; }

        public virtual Client Client { get; set; }

        [NotMapped]
        public int? ClientNumber {
            get {
                return Client != null ? Client.Number : null;
            }
        }
    }

```