Skip to content

Instantly share code, notes, and snippets.

param(
$Module ="importexcel"
)
$proxyCredntial = Get-Credential -Message "Input Proxy User/Password"
#Get WebProxy information from internet controlpanel.this method get it in case of proxy auto-config ,too.
$SystemProxy = [System.Net.WebRequest]::GetSystemWebProxy()
#Access point for Install-PackageProvider cmdlet
$URL = "https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409"
#Get proxy URI for $URL
$ProxyUri = $SystemProxy.GetProxy($URL)
#Update Multiline Text Field Method
$Text = "複数行の
データを
挿入します
"
$Text = $html = $Text.Replace("`r`n","<br />")
if( -not ($item["MultilineTextField"]).EndsWith($html + "</div>") )
{$item["MultilineTextField"] = $html ; $UpdateFlag = $true}
# Read CSOM
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") | Out-Null
# SiteCollection URL
$SiteCollectionUrl = "https://tenant-name.sharepoint.com"
$SiteCollectionUrl = "https://tenant-name.sharepoint.com/sites/subsite"
#if you use on-piremise server, use below
$SiteCollectionUrl = "http://sharepoint.contoso.local/sites/subsite/"
名前
Get-WURebootStatus
概要
Windows Updateの再起動ステータスを表示する.
構文
Get-WURebootStatus [-Silent] [[-ComputerName] <String[]>] [-AutoReboot] [-WhatIf] [-Confirm] [<CommonParameters>]
名前
Get-WUInstall
概要
更新をダウンロードしてインストールします。
構文
Get-WUInstall [[-UpdateType] <String>] [[-UpdateID] <String []>] [[-RevisionNumber] <Int32>] [[-CategoryIDs] <String []>] [-IsInstalled] [-IsHidden ] [-WithHidden] [[-Criteria] <String>] [-ShowSearchCri
条件] [[-RootCategories] <String []>] [[-Category] ​​<String []>] [[-KBArticleID] <String []>] [[-Title] <String>] [[-Severity] < String []>] [[-NotCategory] ​​<String []>] [[-NotKBArticleID] <String []>] [[-N
$ComputerName = $env:COMPUTERNAME
$GroupName ="Administrators"
$Domain = $env:USERDOMAIN
$Account = $env:USERNAME
$ADSIUser = [ADSI]("WinNT://$Domain/$Account")
$ADSIGroup = [ADSI]("WinNT://$ComputerName/$GroupName")
Write-Output "Is $GroupName " $ADSIGroup.IsMember($ADSIUser.AdsPath)
#2020/1/6 Virus Scan after the holidays
if($ADSIGroup.IsMember($ADSIUser.AdsPath)) { #if user blongs Administrators Group,exec below
名前
Import-Excel
概要
Create custom objects from the rows in an Excel worksheet.
構文
Import-Excel [-Path] <String> [[-WorksheetName] <String>] [-StartRow <Int32>] [-EndRow <Int32>] [-StartColumn <Int32>] [-EndColumn <Int32>] [-Dat
名前
Export-Excel
概要
Exports data to an Excel worksheet.
構文
Export-Excel [[-Path] <String>] [-InputObject <Object>] [-Calculate] [-Show] [-WorksheetName <String>] [-Password <S
tring>] [-ClearSheet] [-Append] [-Title <String>] [-TitleFillPattern {None | Solid | DarkGray | MediumGray | LightGr
#ImportExcelをImportする
Import-Module ImportExcel
#ファイルを保存したフォルダを指定します。
$TargetFolder = C:\Temp
#ファイルリストを作ります。
$FileList =Get-ChildItem $TargetFolder -File -Filter *.xlsx
#集約させる入れ物を先に用意します。