PS C:\> $PSVersionTable | sort Name
Name Value
---- -----
PSVersion 5.1.19041.906
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.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
function Get-NETCoreRuntimeVersion () { | |
# pwsh.deps.jsonを検索 | |
$depsJsonPath = Join-Path $PSHOME 'pwsh.deps.json' | |
if (Test-Path $depsJsonPath) { | |
$depsContent = Get-Content -LiteralPath $depsJsonPath | ConvertFrom-Json -AsHashtable | |
$targetName = $depsContent.runtimeTarget.name | |
$pwshTargetName = $depsContent.targets.$targetName.Keys | ? { $_ -like "pwsh*" } | |
return $depsContent.targets.$targetName.$pwshTargetName.dependencies."Microsoft.NETCore.App" | |
} | |
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
<# | |
.SYNOPSIS | |
NICTからJSONで公開されている現在時刻を取得してシステム時刻を更新します。 | |
.DESCRIPTION | |
NICTで公開されているJSON形式の時刻情報を取得してシステムの現在時刻を更新します。 | |
-WhatIf、-Verboseオプションをサポートしています。 | |
システム時刻を更新するには昇格している必要があります。 | |
また、時刻の取得に時間がかかりすぎた場合は処理を中断する様にしています。 | |
.PARAMETER URI |
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
# BASE64 Encode | |
$FilePath = "C:\Windows\Web\Screen\img100.jpg" | |
$EncodedString = [Convert]::ToBase64String([IO.File]::ReadAllBytes($FilePath)) | |
# output | |
Write-Host """$FilePath"" was encoded in $($EncodedString.Length) words." | |
Write-Output $EncodedString | |
# BASE64 Decode | |
$FilePath = "C:\decode_img100.jpg" |
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 Set-AWSCredentialWithRegion { | |
[CmdletBinding()] | |
param ( | |
[string]$ProfileName | |
) | |
# Invoke Set-AWSCredential first | |
Write-Verbose "Invoke Set-AWSCredential -ProfileName $ProfileName " | |
Set-AWSCredential -ProfileName $ProfileName -Scope Global | |
if (-not $StoredAWSCredentials) { |
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
# | |
# Install ADDS/GPMC/RSAT(ADTools) Components | |
# | |
Add-WindowsFeature AD-Domain-Services, GPMC, RSAT-ADDS, RSAT-AD-PowerShell | |
# | |
# Create new Forest/Domain | |
# | |
Import-Module ADDSDeployment | |
$Params = @{ |
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
--- ./migrate_from_trac.rake.orig 2017-08-03 16:07:49.723977200 +0900 | |
+++ ./migrate_from_trac.rake 2017-08-10 13:49:36.119965400 +0900 | |
@@ -118,7 +118,7 @@ namespace :redmine do | |
class TracAttachment < ActiveRecord::Base | |
self.table_name = :attachment | |
- set_inheritance_column :none | |
+ self.inheritance_column = :none | |
def time; Time.at(read_attribute(:time)) end |
設定値 | 内容 |
---|---|
Restricted | 個別のコマンドは許可されますが、スクリプトは実行されません。 |
AllSigned | ローカル コンピューター上で記述されたスクリプトを含むすべてのスクリプトと構成ファイルが、信頼された発行元によって署名されている必要があります。 |