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
#Requires -Version 3.0 | |
#-- SymbolicLink Functions --# | |
<# | |
.SYNOPSIS | |
This function will detect only SymbolicLink items. | |
.DESCRIPTION | |
PowerShell SymbolicLink function. Alternative to mklink Symbolic Link. |
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
#Requires -Version 3.0 | |
<# | |
.SYNOPSIS | |
This function will Set SymbolicLink items for desired Path. | |
.DESCRIPTION | |
PowerShell SymbolicLink function. Alternative to mklink Symbolic Link. | |
This function will create Symbolic Link for input file fullpath. | |
Also it works as like LINQ Zip method for different number items was passed for each -Path and -SymbolicPath. |
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 New-ZipPairs | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter( | |
Mandatory = 1, | |
Position = 0, | |
ValueFromPipelineByPropertyName = 1)] | |
$key, |
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 New-Empty ([string]$type) | |
{ | |
$def = @" | |
public static System.Collections.Generic.IEnumerable<$type> Empty() | |
{ | |
System.Collections.Generic.IEnumerable<$type> empty = System.Linq.Enumerable.Empty<$type>(); | |
return empty; | |
} | |
"@ | |
try |
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 New-Zip | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[parameter( | |
Mandatory = 0, | |
Position = 0, | |
ValueFromPipeline = 1, | |
ValueFromPipelineByPropertyName = 1)] |
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 PipelineExecuteOnEndProcessingStyle | |
{ | |
param | |
( | |
[parameter(Position = 0, Mandatory = 1, ValueFrompipeline = 1, ValueFromPipelineByPropertyName = 1)] | |
[string]$hostaddress | |
) | |
begin{ $hostaddresses = @() } | |
process | |
{ |
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
Add-Type -TypeDefinition @" | |
public enum ValentiaBranchPath | |
{ | |
Application = 1, | |
Deploygroup = 2, | |
Download = 3, | |
Maintenance = 4, | |
Upload = 5, | |
Utils = 6 | |
} |
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
Enum ValentiaBranchPath | |
{ | |
Application = 1 | |
Deploygroup = 2 | |
Download = 3 | |
Maintenance = 4 | |
Upload = 5 | |
Utils = 6 | |
} |
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
######################## | |
# Constructor Call check | |
######################## | |
class Hoge | |
{ | |
Hoge() | |
{ | |
Write-Host "constuctor called" | |
} | |
} |
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
Class CopyItemClass | |
{ | |
[string]$Path | |
[string]$Destination | |
[string]$Item | |
[PSObject] SetItem([string]$Path, [string]$Destination) | |
{ | |
$result = copy-Item -Path $Path -Destination $Destination -PassThru | |
Write-Warning ("Item Copied from {0} to {1}" -f $Path, $Destination) |