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-Folder( $folderName ) { | |
if(Test-Path $folderName) { | |
} | |
else { | |
$currentDirectory = Get-Location | |
$createLocation = "$currentDirectory\$folderName" | |
New-Item -type directory $createLocation | |
} | |
} |
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 CheckFileExist($fileName) { | |
$resultCheckFileExist = Test-Path $fileName | |
if($resultCheckFileExist -eq $false) { | |
#いない場合は怒って終了 | |
Write-Host "ファイル名「$fileName」は存在しません。" | |
return $false | |
} | |
else { | |
return $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
#====================================================================== | |
# author : TearTheSky | |
# フォルダ内のファイル名を一括で変換してくれるすごいやつ(予定) | |
#====================================================================== | |
#---------------------------------------------------------------------- | |
# - - - フォルダ選択ダイアログの表示 - - - | |
#---------------------------------------------------------------------- | |
#フォルダ選択ダイアログの表示 |
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
import-module ActiveDirectory | |
$company = 'tearthesky.com' | |
$usersOU = 'CN=Users,DC=tearthesky,DC=com' | |
write-host "Drop New Users List(CSV File)" | |
$csvFilePath = read-host | |
$newUsers = import-csv $csvFilePath | |
foreach($aUser in $newusers){ |
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
$searchKey = "keyword which you want to search" | |
$outFileName = "result.txt" | |
$Items = get-childitem | |
foreach($aItem in $Items) { | |
$aLog = get-content $aItem | |
$results = @($aLog | select-string $searchKey) | |
$results | out-file $outFileName -append | |
} | |
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
write-output ($counter.tostring() + "人目のユーザアカウントを作成します。よろしいですか?") | |
$yesNo = read-host "(y / n)" | |
while ($yesNo -eq 'y') | |
{ | |
try{ | |
$name = Read-Host '作成したい新規参入者のユーザ名を入力してください。' | |
$server = [adsi]"WinNT://$env:computername" | |
$user = $server.Create("User", "$name") |
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
# トランスクリプト(ログ出力)の開始 | |
$yourLogfilePrefix = 'ログファイルにつけたい名前' | |
try { | |
Stop-Transcript | |
} | |
catch{ | |
Write-Output '既に実行されているトランスクリプトはありません。問題ありません。' | |
} | |
Start-Transcript -Path ( (split-path $MyInvocation.MyCommand.Path) + "\" + $yourLogfilePrefix + $tennant + "_" +(get-date -Format "yyyyMMddhhmmss") + ".log") |
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
<?xml version="1.0" encoding="utf-16"?> | |
<StorableColorTheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | |
<Keys> | |
<string>ErrorForegroundColor</string> | |
<string>ErrorBackgroundColor</string> | |
<string>WarningForegroundColor</string> | |
<string>WarningBackgroundColor</string> | |
<string>VerboseForegroundColor</string> | |
<string>VerboseBackgroundColor</string> | |
<string>DebugForegroundColor</string> |
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
#引数定義 | |
Param ( | |
[string]$pathName = "", | |
[int]$targetSheetNumber = -1, | |
[string]$targetCollumn = "", | |
[int]$targetRow = -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
<!-- HTML内埋め込み --> | |
<style type="text/css"> | |
<!-- | |
#menu li { | |
position: relative; | |
float: left; | |
margin: 0; | |
padding: 5px; | |
width: 200px; |
OlderNewer