-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
everything is broken currently, but moving computers :)
- Loading branch information
Showing
11 changed files
with
210 additions
and
169 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System.Management.Automation; | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Linq; | ||
|
||
using PSSimpleConfig.Utilities; | ||
|
||
namespace PSSimpleConfig.Cmdlets; | ||
|
||
[Cmdlet(VerbsData.Import, "PSSConfig")] | ||
public class ImportPSSConfig : PSCmdlet | ||
{ | ||
[Parameter(Mandatory = true)] | ||
[Alias("Project")] | ||
public string Name { get; set; } | ||
|
||
protected override void ProcessRecord() | ||
{ | ||
JObject config = PSSimpleConfig.ImportConfig(Name); | ||
SessionState.PSVariable.Set("PSSimpleConfig", JsonConversion.ToPSOutput(config)); | ||
WriteObject(SessionState.PSVariable.Get("PSSimpleConfig")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"ModuleCfgRoot": "C:\\Users\\u55398\\Documents\\git\\PSSimpleConfig\\Output\\PSSimpleConfig", | ||
"ModuleCfgFile": "C:\\Users\\u55398\\Documents\\git\\PSSimpleConfig\\Output\\PSSimpleConfig\\PSSimpleConfig.json", | ||
"ProjectCfgRoot": "C:\\ProgramData\\PSSimpleConfig\\Projects", | ||
"Projects": [ | ||
{ | ||
"id": "6a2c1dd2-c06f-4427-a072-2e8fe230ff0a", | ||
"name": "TestProject", | ||
"root": "C:\\Users\\u55398\\Documents\\git\\PSSimpleConfig\\Output\\PSSimpleConfig\\TestProject" | ||
} | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
namespace PSSimpleConfig; | ||
|
||
public class Project | ||
{ | ||
public Guid Id { get; set; } | ||
public string Name { get; set; } | ||
public string Root { get; set; } | ||
|
||
public Project(string name, string root) | ||
{ | ||
Id = Guid.NewGuid(); | ||
Name = name; | ||
Root = root; | ||
} | ||
|
||
public Project(Guid id, string name, string root) | ||
{ | ||
Id = id; | ||
Name = name; | ||
Root = root; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return $"{Name} ({Id})"; | ||
} | ||
|
||
} |
Oops, something went wrong.