This file contains hidden or 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
############################################################################### | |
## Custom Objects Create in C-Sharp | |
############################################################################### | |
$TargetDllPath = (Split-Path -parent $MyInvocation.MyCommand.Path) + "\PowerAlto2.dll" | |
$TestPath = (Split-Path -parent $MyInvocation.MyCommand.Path) + "\test.cs" | |
([System.Reflection.Assembly]::LoadWithPartialName("System.Xml")).Location | |
([System.Reflection.Assembly]::LoadWithPartialName("PowerAlto2")).Location | |
############################################################################### |
This file contains hidden or 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
VERBOSE: Loading module from path 'C:\_strap\poweralto2\poweralto2.psd1'. | |
VERBOSE: Loading 'Assembly' from path 'C:\_strap\poweralto2\PowerAlto2.dll'. | |
VERBOSE: Loading module from path 'C:\_strap\poweralto2\PowerAlto2.psm1'. | |
Add-Type : (0) : Source file 'C:\Windows\TEMP\vl5ovzf4.0.cs' could not be found | |
(1) : using System.Text.RegularExpressions; | |
At C:\_strap\poweralto2\PowerAlto2.psm1:13 char:1 | |
+ Add-Type -ReferencedAssemblies @( | |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+ CategoryInfo : InvalidData: (error CS2001: S...ld not be found:CompilerError) [Add-Type], Exception | |
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands.AddTypeCommand |
This file contains hidden or 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
Add-Type -ReferencedAssemblies @( | |
([System.Reflection.Assembly]::LoadWithPartialName("System.Xml")).Location, | |
([System.Reflection.Assembly]::LoadWithPartialName("System.Web")).Location, | |
([System.Reflection.Assembly]::LoadWithPartialName("System.Xml.Linq")).Location | |
) -TypeDefinition @' | |
using System; | |
using System.Xml; | |
using System.Xml.Linq; | |
using System.Web; | |
using System.Text.RegularExpressions; |
This file contains hidden or 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
VERBOSE: Loading module from path 'C:\_strap\poweralto2\poweralto2.psm1'. | |
Add-Type : (0) : Source file 'C:\Windows\TEMP\e5ntpd5d.0.cs' could not be found | |
(1) : using System; | |
At C:\_strap\poweralto2\poweralto2.psm1:1 char:1 | |
+ Add-Type -ReferencedAssemblies @( | |
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
+ CategoryInfo : InvalidData: (error CS2001: S...ld not be found: | |
CompilerError) [Add-Type], Exception | |
+ FullyQualifiedErrorId : SOURCE_CODE_ERROR,Microsoft.PowerShell.Commands. | |
AddTypeCommand |
This file contains hidden or 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 TestRegex { | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$true,Position=0)] | |
[string]$Line, | |
[Parameter(mandatory=$true,Position=1)] | |
[regex]$Regex | |
) |
This file contains hidden or 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
ipmo dhcpserver | |
$DhcpServer = Read-Host "Dhcp Server?" | |
$Scopes = Get-DhcpServerv4Scope -ComputerName $DhcpServer | |
$ServerOptions = Get-DhcpServerv4OptionValue -ComputerName $DhcpServer | |
foreach ($s in $Scopes) { | |
foreach ($o in $ServerOptions) { | |
Set-DhcpServerv4OptionValue -OptionId $o.OptionId -Value $o.Value -ScopeId $s.ScopeId -ComputerName $DhcpServer | |
} | |
} |
This file contains hidden or 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
############################################################################### | |
# | |
# iSCSI Fixer | |
# Q1 2014 | |
# brian.addicks@lockstepgroup.com | |
# | |
############################################################################### | |
# | |
$DiscoveryPortals = @("192.168.99.19" |
This file contains hidden or 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
param | |
( | |
[System.Management.Automation.CredentialAttribute()] | |
$Credential | |
) |
This file contains hidden or 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
# Changes the terminal profile from one setting to another when entering and exiting powershell. | |
# would be cool to add the ability to read the current profile when starting powershell so you can change back without manually defining it. | |
osascript -e 'tell application \"Terminal\" to set current settings of selected tab of front window to settings set \"Solarized PS\"' | |
Register-EngineEvent powershell.exiting -action { osascript -e 'tell application \"Terminal\" to set current settings of selected tab of front window to settings set \"Solarized Dark\"' -SupportEvent } |
OlderNewer