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 3 years have passed since last update.

PowerShellでIISの仮想ディレクトリを作成

Last updated at Posted at 2021-04-02

PowerShellを使用すればIISのあらゆる操作がコマンドで実行可能です。
環境構築の自動化・効率化に是非活用してください。

IISでアプリケーションとは別に「仮想ディレクトリ」を作成したい場合は以下のコマンドで実現できます。

New-WebVirtualDirectory 
    -Site "Default Web Site"           #サイト名
    -Application "yourApp"             #アプリケーション名
    -Name "virtualDir"                 #仮想ディレクトリ名
    -PhysicalPath "C:\inetpub\realDir" #実フォルダのパス
    -Force                             #確認なしで実行

http://◯◯◯◯/yourApp/virtualDir」という仮想ディレクトリが作成されます。
コメントを記載するため改行しましたが、一行で書くほうが好みです。

参考:公式ドキュメント
https://docs.microsoft.com/ja-jp/powershell/module/webadministration/new-webvirtualdirectory?view=windowsserver2019-ps&viewFallbackFrom=win10-ps

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?