|
|
@@ -0,0 +1,28 @@
|
|
|
+<# : Begin batch (batch script is in commentary of powershell v2.0+)
|
|
|
+@echo off
|
|
|
+: Use local variables
|
|
|
+setlocal
|
|
|
+: Invoke this file as powershell expression
|
|
|
+powershell -executionpolicy remotesigned -Command "Invoke-Expression $([System.IO.File]::ReadAllText('%~f0'))"
|
|
|
+: Restore environment variables present before setlocal and restore current directory
|
|
|
+endlocal
|
|
|
+: optionally if double clicked pause
|
|
|
+: echo %cmdcmdline%|find /i """%~f0""">nul && pause
|
|
|
+: End batch - go to end of file
|
|
|
+goto:eof
|
|
|
+#>
|
|
|
+# here start your powershell script
|
|
|
+
|
|
|
+$o = new-object -com shell.application
|
|
|
+
|
|
|
+$logfile = $env:TEMP + '\pinonedrivetohome.log'
|
|
|
+$logfile
|
|
|
+
|
|
|
+&{
|
|
|
+ $onedrive = '\\tsclient\C\Users\'+$env:USERNAME+'\OneDrive - Wabtec Corporation'
|
|
|
+ $sharepoint = '\\tsclient\C\Users\'+$env:USERNAME+'\Wabtec Corporation'
|
|
|
+ $onedrive
|
|
|
+ $sharepoint
|
|
|
+ $o.Namespace($onedrive).Self.InvokeVerb("pintohome")
|
|
|
+ $o.Namespace($sharepoint).Self.InvokeVerb("pintohome")
|
|
|
+} *> ($logfile)
|