{"id":595,"date":"2010-03-18T12:10:34","date_gmt":"2010-03-18T17:10:34","guid":{"rendered":"http:\/\/jdhitsolutions.com\/blog\/2010\/03\/new-file-shortcut\/"},"modified":"2010-03-18T12:28:56","modified_gmt":"2010-03-18T17:28:56","slug":"new-file-shortcut","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/","title":{"rendered":"New File Shortcut"},"content":{"rendered":"<p>I've been looking at the File Server Resource Manager (FSRM) feature in Windows Server 2008 R2 a lot lately. One very nice part of FSRM is the ability to schedule typical file management tasks. One of the examples from the Microsoft storage team is to create a custom task to move old files to another server and leave a shortcut in place. The files are moved to a more appropriate server and the users can still find their files with practically no fuss. However, this requires Windows Server 2008 R2. If you aren't there yet, you can use my PowerShell function, New-FileShortCut in your archiving process.<!--more--><\/p>\n<p>This will require PowerShell 2.0. But you should be able to run it from your Windows 7 desktop and manage a Windows Server 2003 file server.<\/p>\n<div id=\"codeSnippetWrapper\" style=\"border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;\">\n<div id=\"codeSnippet\" style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\">\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum1\" style=\"color: #606060;\">   1:<\/span> Function New-FileShortcut {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum2\" style=\"color: #606060;\">   2:<\/span> <span style=\"color: #008000;\">#requires -version 2.0<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum3\" style=\"color: #606060;\">   3:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum4\" style=\"color: #606060;\">   4:<\/span> &lt;<span style=\"color: #008000;\">#<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum5\" style=\"color: #606060;\">   5:<\/span> .Synopsis<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum6\" style=\"color: #606060;\">   6:<\/span>     Create a file link shortcut.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum7\" style=\"color: #606060;\">   7:<\/span> .Description<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum8\" style=\"color: #606060;\">   8:<\/span>     This <span style=\"color: #0000ff;\">function<\/span> will create a file shortcut link, a .lnk file. This can be useful when<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum9\" style=\"color: #606060;\">   9:<\/span>     moving files to another location and you want to leave a shortcut behind <span style=\"color: #0000ff;\">in<\/span> place<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum10\" style=\"color: #606060;\">  10:<\/span>     of the orginal file. You must specify a shortcut name ending <span style=\"color: #0000ff;\">in<\/span> .lnk and the target<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum11\" style=\"color: #606060;\">  11:<\/span>     file must already be <span style=\"color: #0000ff;\">in<\/span> place.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum12\" style=\"color: #606060;\">  12:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum13\" style=\"color: #606060;\">  13:<\/span>     This <span style=\"color: #0000ff;\">function<\/span> fully supports -verbose, -confirm and -whatif.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum14\" style=\"color: #606060;\">  14:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum15\" style=\"color: #606060;\">  15:<\/span> .Parameter Name<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum16\" style=\"color: #606060;\">  16:<\/span>     The full filename and path of the shortcut file. It must <span style=\"color: #0000ff;\">end<\/span> <span style=\"color: #0000ff;\">in<\/span> .lnk. You<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum17\" style=\"color: #606060;\">  17:<\/span>     should specify the complete path.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum18\" style=\"color: #606060;\">  18:<\/span> .Parameter Target<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum19\" style=\"color: #606060;\">  19:<\/span>     The full filename and path of the target file. It must exist as it will be<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum20\" style=\"color: #606060;\">  20:<\/span>     verified during the validation <span style=\"color: #0000ff;\">process<\/span>.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum21\" style=\"color: #606060;\">  21:<\/span> .Parameter Passthru<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum22\" style=\"color: #606060;\">  22:<\/span>     By <span style=\"color: #0000ff;\">default<\/span> nothing is written to the pipeline. Use -Passthru to write the shortcut<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum23\" style=\"color: #606060;\">  23:<\/span>     file object to the pipeline.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum24\" style=\"color: #606060;\">  24:<\/span> .Example<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum25\" style=\"color: #606060;\">  25:<\/span>     PS C:\\&gt; New-FileShortcut \\\\file01\\files\\MyData.lnk \\\\file02\\Archive\\MyData.doc<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum26\" style=\"color: #606060;\">  26:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum27\" style=\"color: #606060;\">  27:<\/span>     This will create a shortcut file <span style=\"color: #0000ff;\">for<\/span> MyData on FILE01 that points to the actual<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum28\" style=\"color: #606060;\">  28:<\/span>     file on FILE02.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum29\" style=\"color: #606060;\">  29:<\/span> .Example<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum30\" style=\"color: #606060;\">  30:<\/span>     PS C:\\&gt;  dir H:\\Files\\*.csv | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum31\" style=\"color: #606060;\">  31:<\/span>     $dest=<span style=\"color: #006080;\">\"\\\\File02\\Archive\\files\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum32\" style=\"color: #606060;\">  32:<\/span>       Move-Item $_ -destination $dest<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum33\" style=\"color: #606060;\">  33:<\/span>       New-FileShortcut -name (Join-Path $_.Directory <span style=\"color: #006080;\">\"$($_.basename).lnk\"<\/span> -target (Join-path $dest $_.name) -Passthru<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum34\" style=\"color: #606060;\">  34:<\/span>       }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum35\" style=\"color: #606060;\">  35:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum36\" style=\"color: #606060;\">  36:<\/span>     This example will move all CSV files from H:\\Files to the Archive folder on FILE02. After each file is moved<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum37\" style=\"color: #606060;\">  37:<\/span>     a new shortcut link is left <span style=\"color: #0000ff;\">in<\/span> its place.  Join-Path is used to construct valid file paths and names.<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum38\" style=\"color: #606060;\">  38:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum39\" style=\"color: #606060;\">  39:<\/span> .Inputs<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum40\" style=\"color: #606060;\">  40:<\/span>     None<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum41\" style=\"color: #606060;\">  41:<\/span> .Outputs<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum42\" style=\"color: #606060;\">  42:<\/span>     File object <span style=\"color: #0000ff;\">if<\/span> you use -Passthru<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum43\" style=\"color: #606060;\">  43:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum44\" style=\"color: #606060;\">  44:<\/span> .Link<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum45\" style=\"color: #606060;\">  45:<\/span>    Get-Item<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum46\" style=\"color: #606060;\">  46:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum47\" style=\"color: #606060;\">  47:<\/span> .Notes<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum48\" style=\"color: #606060;\">  48:<\/span>  NAME:      New-FileShortcut<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum49\" style=\"color: #606060;\">  49:<\/span>  VERSION:   1.1<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum50\" style=\"color: #606060;\">  50:<\/span>  AUTHOR:    Jeffery Hicks<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum51\" style=\"color: #606060;\">  51:<\/span>  LASTEDIT:  3\/17\/2010<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum52\" style=\"color: #606060;\">  52:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum53\" style=\"color: #606060;\">  53:<\/span> <span style=\"color: #008000;\">#&gt;<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum54\" style=\"color: #606060;\">  54:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum55\" style=\"color: #606060;\">  55:<\/span> [cmdletBinding(SupportsShouldProcess=$True,ConfirmImpact=<span style=\"color: #006080;\">\"Low\"<\/span>)]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum56\" style=\"color: #606060;\">  56:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum57\" style=\"color: #606060;\">  57:<\/span> Param (<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum58\" style=\"color: #606060;\">  58:<\/span>     [Parameter(Mandatory=$True, ValueFromPipeline=$False,Position=0,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum59\" style=\"color: #606060;\">  59:<\/span>     HelpMessage=<span style=\"color: #006080;\">\"Enter the name of the file shortcut. It must end in .lnk\"<\/span>)]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum60\" style=\"color: #606060;\">  60:<\/span>     [ValidateScript({$_.EndsWith(<span style=\"color: #006080;\">\".lnk\"<\/span>)})]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum61\" style=\"color: #606060;\">  61:<\/span>     [string]$Name,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum62\" style=\"color: #606060;\">  62:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum63\" style=\"color: #606060;\">  63:<\/span>     [Parameter(Mandatory=$True, ValueFromPipeline=$False,Position=1,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum64\" style=\"color: #606060;\">  64:<\/span>     HelpMessage=<span style=\"color: #006080;\">\"Enter the full path to the target file shortcut. The file must already exist.\"<\/span>)]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum65\" style=\"color: #606060;\">  65:<\/span>     [ValidateScript({Test-Path $_})]<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum66\" style=\"color: #606060;\">  66:<\/span>     [string]$Target,<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum67\" style=\"color: #606060;\">  67:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum68\" style=\"color: #606060;\">  68:<\/span>     [Switch]$PassThru<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum69\" style=\"color: #606060;\">  69:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum70\" style=\"color: #606060;\">  70:<\/span> ) <span style=\"color: #008000;\">#end Parameter definition<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum71\" style=\"color: #606060;\">  71:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum72\" style=\"color: #606060;\">  72:<\/span> Begin {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum73\" style=\"color: #606060;\">  73:<\/span>     write-verbose <span style=\"color: #006080;\">\"Starting function\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum74\" style=\"color: #606060;\">  74:<\/span>     write-verbose <span style=\"color: #006080;\">\"Creating the shell COM Object\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum75\" style=\"color: #606060;\">  75:<\/span>     $wshell=New-Object -ComObject <span style=\"color: #006080;\">\"Wscript.Shell\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum76\" style=\"color: #606060;\">  76:<\/span> } <span style=\"color: #008000;\">#end Begin scriptblock<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum77\" style=\"color: #606060;\">  77:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum78\" style=\"color: #606060;\">  78:<\/span> Process {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum79\" style=\"color: #606060;\">  79:<\/span>     write-verbose <span style=\"color: #006080;\">\"Creating a shortcut for $target as $name\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum80\" style=\"color: #606060;\">  80:<\/span>     <span style=\"color: #008000;\">#shortcut will be saved in System32 folder unless a full path<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum81\" style=\"color: #606060;\">  81:<\/span>     <span style=\"color: #008000;\">#is specified. If the user just puts in a filename, assume<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum82\" style=\"color: #606060;\">  82:<\/span>     <span style=\"color: #008000;\">#they want the file in the current directory.<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum83\" style=\"color: #606060;\">  83:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum84\" style=\"color: #606060;\">  84:<\/span>     <span style=\"color: #0000ff;\">if<\/span> (split-path $name -Parent) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum85\" style=\"color: #606060;\">  85:<\/span>         $linkpath=$name<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum86\" style=\"color: #606060;\">  86:<\/span>     }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum87\" style=\"color: #606060;\">  87:<\/span>     <span style=\"color: #0000ff;\">else<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum88\" style=\"color: #606060;\">  88:<\/span>         $linkpath=Join-path (get-location) $name<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum89\" style=\"color: #606060;\">  89:<\/span>         write-verbose <span style=\"color: #006080;\">\"Adjusting link file to $linkpath\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum90\" style=\"color: #606060;\">  90:<\/span>     }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum91\" style=\"color: #606060;\">  91:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum92\" style=\"color: #606060;\">  92:<\/span>     $shortcut=$wshell.CreateShortcut($linkpath)<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum93\" style=\"color: #606060;\">  93:<\/span>     $shortcut.TargetPath=$target<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum94\" style=\"color: #606060;\">  94:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum95\" style=\"color: #606060;\">  95:<\/span>     <span style=\"color: #0000ff;\">if<\/span> ($pscmdlet.ShouldProcess($Target)) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum96\" style=\"color: #606060;\">  96:<\/span>         write-verbose <span style=\"color: #006080;\">\"Saving shortcut\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum97\" style=\"color: #606060;\">  97:<\/span>         $shortcut.Save()<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum98\" style=\"color: #606060;\">  98:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum99\" style=\"color: #606060;\">  99:<\/span>         <span style=\"color: #0000ff;\">if<\/span> ($passthru) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum100\" style=\"color: #606060;\"> 100:<\/span>             write-verbose <span style=\"color: #006080;\">\"Passing shortcut file object to the pipeline\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum101\" style=\"color: #606060;\"> 101:<\/span>             <span style=\"color: #008000;\">#write the new shortcut file object to the pipeline if -Passthru<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum102\" style=\"color: #606060;\"> 102:<\/span>             Get-item $shortcut.fullname<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum103\" style=\"color: #606060;\"> 103:<\/span>         }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum104\" style=\"color: #606060;\"> 104:<\/span>     }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum105\" style=\"color: #606060;\"> 105:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum106\" style=\"color: #606060;\"> 106:<\/span>  } <span style=\"color: #008000;\">#end Process scriptblock<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum107\" style=\"color: #606060;\"> 107:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum108\" style=\"color: #606060;\"> 108:<\/span>  End {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum109\" style=\"color: #606060;\"> 109:<\/span>     write-verbose <span style=\"color: #006080;\">\"Removing the shell object\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum110\" style=\"color: #606060;\"> 110:<\/span>     Remove-variable wshell -confirm:$false<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum111\" style=\"color: #606060;\"> 111:<\/span>     write-verbose <span style=\"color: #006080;\">\"Ending function\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum112\" style=\"color: #606060;\"> 112:<\/span>  } <span style=\"color: #008000;\">#end End scriptblock<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum113\" style=\"color: #606060;\"> 113:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum114\" style=\"color: #606060;\"> 114:<\/span> } #<span style=\"color: #0000ff;\">end<\/span> Function<\/pre>\n<p><!--CRLF--><\/p>\n<\/div>\n<\/div>\n<p>The function includes comment-based help to make it easier to understand and use.<\/p>\n<p><a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/image.png\"><img loading=\"lazy\" decoding=\"async\" style=\"display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;\" title=\"image\" src=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/image_thumb.png\" border=\"0\" alt=\"image\" width=\"484\" height=\"252\" \/><\/a><\/p>\n<p>I\u2019ve also taken the liberty of including support for \u2013Verbose, \u2013WhatIf and \u2013Confirm. Not that creating a shortcut is that serious but I thought it might be worthwhile as a demonstration. These are defined with the cmdletBinding statement.<\/p>\n<p><span style=\"font-family: Courier New; color: #0000ff;\">[cmdletBinding(SupportsShouldProcess=$True,ConfirmImpact=\"Low\")]<\/span><\/p>\n<p>The Write-Verbose lines only execute if you use \u2013Verbose. The SupportsShouldProcess setting is used when \u2013WhatIf is specified. This block of code is configured to handle \u2013WhatIf.<\/p>\n<div id=\"codeSnippetWrapper\" style=\"border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;\">\n<div id=\"codeSnippet\" style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\">\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum1\" style=\"color: #606060;\">   1:<\/span> <span style=\"color: #0000ff;\">if<\/span> ($pscmdlet.ShouldProcess($Target)) {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum2\" style=\"color: #606060;\">   2:<\/span>        write-verbose <span style=\"color: #006080;\">\"Saving shortcut\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum3\" style=\"color: #606060;\">   3:<\/span>        $shortcut.Save()<\/pre>\n<p><!--CRLF--><\/p>\n<\/div>\n<\/div>\n<p>Using \u2013WhatIf turns line 1 into a False statement so the shortcut is never saved.\u00a0 The method value I\u2019m using, $Target, is what PowerShell displays in the WhatIf statement. I could have used any variable. In my case it made more sense to show the target file. If \u2013Whatif isn\u2019t specified then this line is True and the file is saved.<\/p>\n<p>The ConfirmImpact setting tells PowerShell to prompt me if \u2013Confirm is passed. If you always want to be confirmed, you can set this value to \u201cHigh\u201d.<\/p>\n<p>The function itself is a wrapper for the Wscript.Shell COM object that you use in VBScript. This object has a CreateShortcut() method. All my function is doing is creating a simple shortcut. By default the function doesn\u2019t write anything to the pipeline, but you can use \u2013Passthru to see the actual file. I couldn\u2019t think of a good situation where you might want to use this in a pipelined expression so I kept it simple. Feel free to edit the function if you want to reverse this behavior.<\/p>\n<p>Alright. Now that we have this function how can we use it in our file management task? Conceptually you would use Get-Childitem to retrieve what ever set of files you want to manage. Move them to the new location then create a shortcut in the original directory that points to the moved file.<\/p>\n<div id=\"codeSnippetWrapper\" style=\"border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;\">\n<div id=\"codeSnippet\" style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\">\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum1\" style=\"color: #606060;\">   1:<\/span> dir \\\\File01\\Files\\*.csv | <span style=\"color: #0000ff;\">foreach<\/span> {<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum2\" style=\"color: #606060;\">   2:<\/span>   $dest=<span style=\"color: #006080;\">\"\\\\File02\\Archive\\files\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum3\" style=\"color: #606060;\">   3:<\/span>   Move-Item $_ -destination $dest<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum4\" style=\"color: #606060;\">   4:<\/span>   $link=(Join-Path $_.Directory <span style=\"color: #006080;\">\"$($_.basename).lnk\"<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum5\" style=\"color: #606060;\">   5:<\/span>   $target=(Join-path $dest $_.name)<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum6\" style=\"color: #606060;\">   6:<\/span>   New-FileShortcut -name $link  -target $target -Passthru<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum7\" style=\"color: #606060;\">   7:<\/span>  }<\/pre>\n<p><!--CRLF--><\/p>\n<pre style=\"border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;\"><span id=\"lnum8\" style=\"color: #606060;\">   8:<\/span><\/pre>\n<p><!--CRLF--><\/p>\n<\/div>\n<\/div>\n<p>In this example I\u2019m getting all CSV files from \\\\File01\\Files. Each file is moved to the new destination and to keep it easy to follow I' define values for the link file (did I mention it must end in .lnk?) and the target file. I want to make sure the link file keeps the same basename and is in the same directory. But just like that all the CSV files are moved, leaving shortcut links in their place. When the user goes to the share and double clicks the CSV icon, they\u2019ll actually open the file from the other server.<\/p>\n<p>You can download the script file <a href=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/New-FileShortCut.txt\">here.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been looking at the File Server Resource Manager (FSRM) feature in Windows Server 2008 R2 a lot lately. One very nice part of FSRM is the ability to schedule typical file management tasks. One of the examples from the Microsoft storage team is to create a custom task to move old files to another&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[75,8,135],"tags":[97,163,32,534,172,170,171],"class_list":["post-595","post","type-post","status-publish","format-standard","hentry","category-powershell-v2-0","category-scripting","category-windows-server","tag-filesystem","tag-fsrm","tag-functions","tag-powershell","tag-shortcut","tag-wscript","tag-wsh"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>New File Shortcut &#8226; The Lonely Administrator<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"New File Shortcut &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"I&#039;ve been looking at the File Server Resource Manager (FSRM) feature in Windows Server 2008 R2 a lot lately. One very nice part of FSRM is the ability to schedule typical file management tasks. One of the examples from the Microsoft storage team is to create a custom task to move old files to another...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2010-03-18T17:10:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2010-03-18T17:28:56+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/image_thumb.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"New File Shortcut\",\"datePublished\":\"2010-03-18T17:10:34+00:00\",\"dateModified\":\"2010-03-18T17:28:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/\"},\"wordCount\":558,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/03\\\/image_thumb.png\",\"keywords\":[\"FileSystem\",\"FSRM\",\"functions\",\"PowerShell\",\"Shortcut\",\"Wscript\",\"WSH\"],\"articleSection\":[\"PowerShell v2.0\",\"Scripting\",\"Windows Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/\",\"name\":\"New File Shortcut &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/03\\\/image_thumb.png\",\"datePublished\":\"2010-03-18T17:10:34+00:00\",\"dateModified\":\"2010-03-18T17:28:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/03\\\/image_thumb.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2010\\\/03\\\/image_thumb.png\",\"width\":\"484\",\"height\":\"252\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/scripting\\\/595\\\/new-file-shortcut\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell v2.0\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell-v2-0\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"New File Shortcut\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"New File Shortcut &#8226; The Lonely Administrator","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/","og_locale":"en_US","og_type":"article","og_title":"New File Shortcut &#8226; The Lonely Administrator","og_description":"I've been looking at the File Server Resource Manager (FSRM) feature in Windows Server 2008 R2 a lot lately. One very nice part of FSRM is the ability to schedule typical file management tasks. One of the examples from the Microsoft storage team is to create a custom task to move old files to another...","og_url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/","og_site_name":"The Lonely Administrator","article_published_time":"2010-03-18T17:10:34+00:00","article_modified_time":"2010-03-18T17:28:56+00:00","og_image":[{"url":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/image_thumb.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"New File Shortcut","datePublished":"2010-03-18T17:10:34+00:00","dateModified":"2010-03-18T17:28:56+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/"},"wordCount":558,"commentCount":2,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/image_thumb.png","keywords":["FileSystem","FSRM","functions","PowerShell","Shortcut","Wscript","WSH"],"articleSection":["PowerShell v2.0","Scripting","Windows Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/","url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/","name":"New File Shortcut &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/#primaryimage"},"thumbnailUrl":"http:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/image_thumb.png","datePublished":"2010-03-18T17:10:34+00:00","dateModified":"2010-03-18T17:28:56+00:00","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/image_thumb.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2010\/03\/image_thumb.png","width":"484","height":"252"},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/scripting\/595\/new-file-shortcut\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell v2.0","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},{"@type":"ListItem","position":2,"name":"New File Shortcut"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":610,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell-v2-0\/610\/powershell-quick-start-on-server-core-r2\/","url_meta":{"origin":595,"position":0},"title":"PowerShell Quick Start on Server Core R2","author":"Jeffery Hicks","date":"March 29, 2010","format":false,"excerpt":"The great thing about the Server Core flavor that ships with Windows Server 2008 R2 is that it finally supports Windows PowerShell. I\u2019ve talked about this before. However, I think I neglected some of the finer points in getting started. You can (and should) run PowerShell on your R2 Core\u2026","rel":"","context":"In &quot;PowerShell v2.0&quot;","block_context":{"text":"PowerShell v2.0","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell-v2-0\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":573,"url":"https:\/\/jdhitsolutions.com\/blog\/commandline\/573\/power-up-your-r2-server-core-shell\/","url_meta":{"origin":595,"position":1},"title":"Power Up your R2 Server Core Shell","author":"Jeffery Hicks","date":"January 27, 2010","format":false,"excerpt":"I've recently started using the Server Core option for my test servers, especially for things like domain controllers. I can get by with smaller disk and memory requirements. Once you get the server configured, there's very little you have to do that actually requires logging on to the server. Which\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3510,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/3510\/out-with-the-windows-old\/","url_meta":{"origin":595,"position":2},"title":"Out with the Windows.old","author":"Jeffery Hicks","date":"October 23, 2013","format":false,"excerpt":"Over the last few days I've started the process of upgrading my test virtual machines to Windows Server 2012 R2, or in the case of my mini Hyper-V server, to the final bits of Windows Hyper-V Server 2012 R2. In many cases I had been running the preview bits. I\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"over-the-hill","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/10\/over-the-hill.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":587,"url":"https:\/\/jdhitsolutions.com\/blog\/scripting\/587\/techmentor-orlando-2010-decks-and-demos\/","url_meta":{"origin":595,"position":3},"title":"TechMentor Orlando 2010 Decks and Demos","author":"Jeffery Hicks","date":"March 15, 2010","format":false,"excerpt":"I had a great time in Orlando at the TechMentor conference. The crowd was enthusiastic and asked good questions. As promised, here are my slide decks and demos. My sessions tend to be heavy on demonstration so I can't promise you'll get a ton of value from the decks alone.\u00a0\u2026","rel":"","context":"In &quot;CommandLine&quot;","block_context":{"text":"CommandLine","link":"https:\/\/jdhitsolutions.com\/blog\/category\/commandline\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":3625,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3625\/i-want-powershell-4-0\/","url_meta":{"origin":595,"position":4},"title":"I Want PowerShell 4.0","author":"Jeffery Hicks","date":"January 22, 2014","format":false,"excerpt":"I've been writing a bit about PowerShell 4.0 lately, especially on my Prof. PowerShell column. If you are running Windows 7 it isn't too difficult to go to http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=40855 and download the Windows Management Framework 4 package. Remember you will also need version 4.5 of the .NET Framework. This will\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"021913_2047_WordTest1.png","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/02\/021913_2047_WordTest1.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":2856,"url":"https:\/\/jdhitsolutions.com\/blog\/active-directory\/2856\/techdays-san-francisco\/","url_meta":{"origin":595,"position":5},"title":"TechDays San Francisco","author":"Jeffery Hicks","date":"March 12, 2013","format":false,"excerpt":"I'm very excited to announce that I'll be presenting at TechDays San Francisco this year. The event runs May 2nd and 3rd. You can find the schedule here. Registration will be forthcoming. Seating will be limited so you won't want to delay once it opens up. As you might expect\u2026","rel":"","context":"In &quot;Active Directory&quot;","block_context":{"text":"Active Directory","link":"https:\/\/jdhitsolutions.com\/blog\/category\/active-directory\/"},"img":{"alt_text":"talkbubble-v3","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2012\/05\/talkbubble-v3-150x150.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=595"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/595\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}