Skip to content

Commit

Permalink
Merge pull request #2 from spyder007/feature/rename
Browse files Browse the repository at this point in the history
Renamed to comply with .net standards
  • Loading branch information
spyder007 authored Dec 6, 2023
2 parents bb7c89d + e4b1ef4 commit 6ffeedc
Show file tree
Hide file tree
Showing 16 changed files with 24 additions and 18 deletions.
12 changes: 9 additions & 3 deletions Deploy-ToMachine.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
param (
$machineName="",
$serviceSharePath="services\spydersoft.hyperv.info\",
$serviceSharePath="services\Spydersoft.Hyperv.Info\",
$serviceName="hyperv.info"
)

Push-Location ./spydersoft.hyperv.info
Push-Location ./Spydersoft.Hyperv.Info
dotnet build -c Release

Pop-Location
Expand All @@ -13,9 +13,15 @@ Pop-Location
$s = New-PSSession -ComputerName $machineName
Enter-PSSession -Session $s
Invoke-Command -Session $s -ArgumentList $serviceName -ScriptBlock { Write-Host "Stopping Service $($args[0])"; Stop-Service "$($args[0])" }

Write-Host "Saving Appsettings";
Copy-Item "\\$($machineName)\$($serviceSharePath)\appsettings.json" "temp.appsettings.json"

Write-Host "Copying files to $machineName"
Copy-Item -Recurse -Force spydersoft.hyperv.info\bin\Release\net6.0\* "\\$($machineName)\$($serviceSharePath)"
Copy-Item -Recurse -Force Spydersoft.Hyperv.Info\bin\Release\net6.0\* "\\$($machineName)\$($serviceSharePath)"

Write-Host "Loading Appsettings";
Move-Item "temp.appsettings.json" "\\$($machineName)\$($serviceSharePath)\appsettings.json" -Force

Invoke-Command -Session $s -ArgumentList $serviceName -ScriptBlock { Write-Host "Starting Service $($args[0])"; Start-Service "$($args[0])" }
Remove-PSSession -Session $s
Expand Down
2 changes: 1 addition & 1 deletion spydersoft.hyperv.info.sln → Spydersoft.Hyperv.Info.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32421.90
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "spydersoft.hyperv.info", "spydersoft.hyperv.info\spydersoft.hyperv.info.csproj", "{355047D3-1ECA-4DCE-B1C3-743713A96A70}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spydersoft.Hyperv.Info", "Spydersoft.Hyperv.Info\Spydersoft.Hyperv.Info.csproj", "{355047D3-1ECA-4DCE-B1C3-743713A96A70}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace spydersoft.hyperv.info.Models
namespace Spydersoft.Hyperv.Info.Models
{
public record VirtualMachine(string Name, string State, int AutomaticStartDelay, long ProcessorCount, long MemoryAssigned, int? StartGroup, int? DelayOffset)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace spydersoft.hyperv.info.Models
namespace Spydersoft.Hyperv.Info.Models
{
public class VirtualMachineDetails
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace spydersoft.hyperv.info.Options
namespace Spydersoft.Hyperv.Info.Options
{
public class HostSettings
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace spydersoft.hyperv.info.Options
namespace Spydersoft.Hyperv.Info.Options
{
public class IdentitySettings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Serilog;
using spydersoft.hyperv.info.Models;
using spydersoft.hyperv.info.Options;
using spydersoft.hyperv.info.Services;
using Spydersoft.Hyperv.Info.Models;
using Spydersoft.Hyperv.Info.Options;
using Spydersoft.Hyperv.Info.Services;
using System.Diagnostics;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using spydersoft.hyperv.info.Models;
using Spydersoft.Hyperv.Info.Models;
using System.Text.Json;

namespace spydersoft.hyperv.info.Services
namespace Spydersoft.Hyperv.Info.Services
{
public class HyperVService : IHyperVService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using spydersoft.hyperv.info.Models;
using Spydersoft.Hyperv.Info.Models;

namespace spydersoft.hyperv.info.Services
namespace Spydersoft.Hyperv.Info.Services
{
public interface IHyperVService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Management.Automation;

namespace spydersoft.hyperv.info.Services
namespace Spydersoft.Hyperv.Info.Services
{
public interface IPowershellExecutor
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace spydersoft.hyperv.info.Services
namespace Spydersoft.Hyperv.Info.Services
{
public class PowershellExecutor : IPowershellExecutor
{
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"defaultVariables": "Configuration=Debug",
"documentGenerator": {
"aspNetCoreToOpenApi": {
"project": "spydersoft.hyperv.info.csproj",
"project": "Spydersoft.Hyperv.Info.csproj",
"msBuildProjectExtensionsPath": null,
"configuration": "$(Configuration)",
"runtime": null,
Expand Down

0 comments on commit 6ffeedc

Please sign in to comment.