Skip to content

Instantly share code, notes, and snippets.

Import-Module Pester -MinimumVersion 4.0
Describe "テスト失敗時のスタックトレース表示確認"{
Context "通常実行"{
It "テスト01(日本語カルチャ)"{
# UIロケールが日本語となっていることを確認
[System.Threading.Thread]::CurrentThread.CurrentUICulture | Should -Be ([cultureInfo]::GetCultureInfo('ja-jp'))
# テスト失敗時の表示確認
$true | Should -Be $false
@altrive
altrive / TLSVersionCheck.md
Last active January 13, 2018 16:59
How to check TLS version by MessageAnalyzer

Office 365 stop supporting TLS 1.0/1.1 at March 1st 2018.
It may required to applying windows patch and registry settings (for application targetting .NET 4.6 or prior version)

Then, it need to ensure old protocols are not used.

Confirm TLS version by Message Analyzer

Use following filter to show only SSL/TLS ClientHello traffics.

(SSL) or (TLS.records[0].fragment[0].msg_type == TLS.HandshakeType.client_hello)
@altrive
altrive / Allure.md
Last active October 28, 2017 18:03
Using Allure for .NET project

概要

Allure は複数言語に対応したテストレポート作成ツールです。
.NETにも対応しており、単体テスト(MsTest/NUnit/xUnit.NET等)の出力から
以下のようなHTMLレポートを作成することができます。

参考情報:

  • 公式サイト ()
@altrive
altrive / InstallDnSpy.ps1
Created October 9, 2017 06:51
dnSpy installation script by using scoop
#Define scoop app manifest
$manifest = [ordered] @{
homepage = 'https://github.com/0xd4d/dnSpy'
version = '4.0.0'
# TODO: Use latest build from <https://ci.appveyor.com/project/0xd4d/dnspy>
url = 'https://github.com/0xd4d/dnSpy/releases/download/v4.0.0-beta1/dnSpy.zip'
hash = '25da2e9dc426a78b75235906a166b597054f8ae1247c212520023e13b5474f62'
bin = @(
'dnSpy.exe',
'dnSpy.Console.exe'
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
<Query Kind="Program">
<NuGetReference>Newtonsoft.Json</NuGetReference>
<NuGetReference Version="4.5.0-alpha01" Prerelease="true">NLog</NuGetReference>
<Namespace>NLog</Namespace>
<Namespace>NLog.Config</Namespace>
<Namespace>NLog.Targets</Namespace>
<Namespace>Newtonsoft.Json</Namespace>
</Query>
void Main()
@altrive
altrive / Get-EtwTraceProvider.ps1
Created January 6, 2016 20:33
GetTraceProviderList sample
#Get-EtwTraceProvider Cmdlet don't return ProviderName
#and some providers returns invalid guid? (invalid parentheses pair)
# Error at: {E02A841C-75A3-4FA7-AFC8-AE09CF9B7F23)
Get-EtwTraceProvider | foreach{ $_.guid;[Guid]::Parse($_.guid)}
@altrive
altrive / PSConnect_WatchList.md
Last active November 12, 2019 16:10
My PowerShell Connect Site WatchList

ConnectのWatchListまとめ。

Add equivalent of c# using statement to powershell (Vote:3)

https://connect.microsoft.com/PowerShell/Feedback/Details/1220115
C#と同様にusingキーワード使ったDispose構文をサポートしてほしい。

ISE hangs after using a Windows Forms dialog (Vote:7)

https://connect.microsoft.com/PowerShell/Feedback/Details/1224213
ISEでShowDialog呼んでしばらくするとISEがクラッシュする問題。一応、Dispatcher通すと問題を回避できる。

@altrive
altrive / Test-Remotely.ps1
Created May 9, 2015 04:38
Remotely PowerShell Module Tests
function Test-Message
{
Write-Verbose "Test Message" -Verbose
}
Describe "Test-Remotely"{
It "Send local function to remote session"{
#Arrange: Send local function definition to remote session
Remotely ([ScriptBlock]::Create(${Function:Test-Message}.Ast.Extent.Text))