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
public class DeviceDbContext : LuxidorDbContext<DeviceDbContext> | |
{ | |
public IDbSet<DeviceState> Devices { get; set; } | |
public IDbSet<AssetShapeState> AssetShapes { get; set; } | |
public IDbSet<AssetStrengthState> AssetStrengths { get; set; } | |
public IDbSet<AssetTypeState> AssetTypes { get; set; } | |
public IDbSet<CountryState> Countries { get; set; } | |
public IDbSet<CurrencyState> Currencies { get; set; } | |
public IDbSet<EventTypeState> EventTypes { get; set; } | |
public IDbSet<UserState> Users { get; set; } |
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
public class ConnectionStringProvider : IConnectionStringProvider | |
{ | |
private static string _connectionString; | |
public ConnectionStringProvider() | |
{ | |
SetupConnectionString(); | |
} | |
private void SetupConnectionString() |
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
function Create-Shortcut | |
{ | |
<# | |
.SYNOPSIS | |
Create a windows shortcut to an desired executable (.EXE) | |
.DESCRIPTION | |
Create a windows shortcut to an desired executable (.EXE) | |
.EXAMPLE | |
Create-AOLShortcut -Path C:\User\Desktop\MyNotepadShortcut.lnk -Target C:\Windows\Notepad.exe -Arguments C:\file.txt -Icon C:\Windows\Notepad.exe,0 | |
#> |
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
# Modify system environment path variable | |
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + $pwd ,[System.EnvironmentVariableTarget]::Machine) |
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 scripts will dump all (basic) IIS configuration to text file on the following path c:\iisconfig.txt | |
$rootDrive = "C:\"; | |
$iisConfigFile = "iis_config.txt"; | |
$websitesOutputFile = "websites.txt"; | |
$apppoolsOutputFile = "apppools.txt"; | |
$iisConfigFilePath = Join-Path $rootDrive $iisConfigFile; | |
$websitesFilePath = Join-Path $rootDrive $websitesOutputFile; | |
$apppoolsFilePath = Join-Path $rootDrive $apppoolsOutputFile; |
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
function Get-AOLMsBuildPath() | |
{ | |
<# | |
.SYNOPSIS | |
Gets the path to the latest version of MsBuild.exe. Throws an exception if MsBuild.exe is not found. | |
.DESCRIPTION | |
Gets the path to the latest version of MsBuild.exe. Throws an exception if MsBuild.exe is not found. | |
.EXAMPLE |
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
function Test-Numeric | |
{ | |
<# | |
.SYNOPSIS | |
Test if an string contains a numeric value | |
.DESCRIPTION | |
Test if an string contains a numeric value | |
.EXAMPLE | |
Test-Numeric -Number ABC70753 returns false | |
Test-Numeric -Number 70753 returns true |
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
function Get-ExecutingScriptFolder() { | |
return Split-Path -Parent $MyInvocation.MyCommand.Path; | |
} |
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
function Get-ExecutingScript() { | |
return $MyInvocation.MyCommand.Path; | |
} |
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
function Test-Administrator | |
{ | |
<# | |
.SYNOPSIS | |
Returns True is the current user is an administrator | |
.DESCRIPTION | |
Returns True is the current user is an administrator | |
.EXAMPLE | |
if(Test-Administrator) { Action } | |
#> |