1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SharePointのURLエンコードかかったリンクを日本語に戻す(PowerShell版)

Last updated at Posted at 2023-07-29

はじめに

 SharePointやTeamsで日本語含むリンクをコピー&ペーストすると、パスにURLエンコードがかかって、長いし何のパスかわからない。リンクを日本語変換してから貼り付けたいなと思い調べてみた。

Python版はこちら

URLデコード

PowerShellで日本語のURLへデコードする方法。
$urlがデコードしたいURLだった場合の例。

Add-Type -AssemblyName System.Web
[System.Web.HttpUtility]::UrlDecode($url)

クリップボーにURL出力

クリップボードのURLをデコードし、再度クリップボードにコピーするまでの一連の処理の例。

#-------------------------
#URL変換関数
#-------------------------
function URL_decode($url){
    Add-Type -AssemblyName System.Web
	return [System.Web.HttpUtility]::UrlDecode($url)
}

#クリップボードからURL取得し変換
$url=URL_decode(Get-Clipboard)

#クリップボードにコピー
Set-Clipboard $url
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?