This file contains hidden or 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
$webclient = New-Object System.Net.WebClient | |
$url = "https://github.com/MyTwitter/MyTwitter/archive/master.zip" | |
Write-Host "Downloading latest version of MyTwitter from $url" -ForegroundColor Cyan | |
$file = "$($env:TEMP)\MyTwitter.zip" | |
$webclient.DownloadFile($url,$file) | |
Write-Host "File saved to $file" -ForegroundColor Green | |
$targetondisk = $env:PSModulePath.Split(";")[0] | |
New-Item -ItemType Directory -Force -Path $targetondisk | out-null | |
$shell_app=new-object -com shell.application | |
$zip_file = $shell_app.namespace($file) |
This file contains hidden or 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
# サイトURLを指定 | |
$webUrl = "http://yamasp2016/sites/es2_20160726" | |
# ページURLを指定 | |
$pageUrl = "Pages/page1.aspx" | |
Add-PSSnapin "Microsoft.SharePoint.PowerShell" | |
#サイトを取得 | |
$web = Get-SPWeb $webUrl | |
#ページ(SPFile)取得 |
This file contains hidden or 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
// モダンUI無効化サイト機能のIDを指定 | |
var featId4Web = "{52E14B6F-B1BB-4969-B89B-C4FAA56745EF}"; // SPListNextWebOptOut for Web | |
// コンテキスト取得 | |
var custCtx = new SP.ClientContext(); | |
// 対象の機能(Feature)を追加(Activate)予約 | |
var feat4Web = custCtx.get_web().get_features().add(new SP.Guid(featId4Web), true, SP.FeatureDefinitionScope.none); | |
// 機能(Feature) オブジェクト取得予約 |
This file contains hidden or 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
Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); | |
IDictionary<string, string> staticAppSettings = ConfigService.GetStaticAppSettings(); | |
foreach (var setting in staticAppSettings) | |
{ | |
if (ConfigurationManager.AppSettings[setting.Key] == null) | |
config.AppSettings.Settings.Add(setting.Key, setting.Value); | |
else | |
ConfigurationManager.AppSettings[setting.Key] = setting.Value; |