Powershell IE webpage Automation

Alright so here's my problem i've been trying to automate an IE session, i've got the logging into the website down just trying to input Into a Search field,
change a dropdown selection and click the Go button. I've been trying to use $ie.Document.getElementById("").value
= $variable and multiple variations of getElementByTagName, getElementByName, so on....with no luck, the html code has no id tag so i feel like that is making this more complicated than it needs to be, so below i will post the html code for the input box,
go button so on and some of the code i've been trying to use. Any ideas would be greatly appreciated, thanks!
HTML Code
Selection Drop Down Html Code
<select onchange="SearchProperty_OnChange(this);"
class="SearchFormSelectList" name="SearchProperty"><option value="displayName">User Display name</option><option selected="" value="userPrincipalName">Logon
name</option><option value="samAccountName">Logon name (pre-W2K)</option><option value="$McsFriendlyName">Name</option><option
value="description">Description</option><option
value="$McsFriendlyPath">User Path</option></select>
Search Field html code
<input type="text" class="FormTextInput" name="MatchString" value="" size="20">
Go Button html code
<input class="formButton" type="submit" value="Go">
My CODE
$userurl = "res://ieframe.dll/invalidcert.htm?SSLError=50331648#mywebsite.com"
$ie = New-Object -comobject InternetExplorer.Application
$ie.visible = $true
$ie.silent = $true
$ie.Navigate( $userurl )
while( $ie.busy){Start-Sleep 1}
$secLink = $ie.Document.getElementsByTagName('A')
| Where-Object {$_.innerText -eq 'Continue to this website (not recommended).'}
$secLink.click()
while( $ie.busy){Start-Sleep 1}
##########################ABOVE
CODE WORKS
#Logon code
$iexp = Select-Window iexplore | Set-WindowActive
$iexp | Send-Keys "DOMAIN\$USERNAME{TAB}$p{TAB}{TAB}{ENTER}"
#Another issue i have is with the logon code it attempts to enter the password twice for some reason...but this results in #opening a new IE windows and it trys to
search the password...not sure what is happening there...
#Here is my main issue...i've tried multiple variations of this code with no success....none of these work
$ie.Document.getElementByTagName("MatchString").value
= $usersearch
$ie.Document.getElementById("MatchString").value
= $usersearch
$ie.Document.getElementById("input.formtextinput").value
= $usersearch
$ie.Document.getElementById("formtextinput").value
= $usersearch
$ie.Document.getElementByTagName("SearchProperty").value
= "Logon name"
$Go = $ie.Document.getElementsByValue('Go')#
| where {$_.innerText -eq 'Go'}
$Go.click()

How can WASP compensate for a lack of IDs.
You have to realize that web pages are not designed for automation and that the browser is designed t obfuscate attempts to hack a page.  WHat you can get awaya with is limited and usually requires extreme patience to work out the variations in page
delivery.
You can use The WebRequest class to "GET" a page and use it to post back a "SUBMIT" once you understand what the page is requiring inn the postback. 
The biggest first issue is how to extract information from a context.  You can use Regex as long as the context is relatively stable and unique.  This is where the patience come in.  You need to insect the context an find a pattern that identifies
it uniquely.  If its only unigueness is <td>item</td> then you are lost.
You can also use GetElementByTagName ... to narrow the scopy if you can find a way to identify which table or td the item is in.
Good luck.
¯\_(ツ)_/¯

Similar Messages

  • Powershell to pull BitLocker Encryption status

    1) enable PSremoting on all laptops --best way is via GPO or any other way to do it?If you are dealing with domain computer, then yes, GPO is the way to go
    2) I want to run this on a few hundreds laptops so I don't want to manually enter my credentialsChange this:Powershell[system.Management.Automation.PSCredential]$Credentialto this:
    Powershell[system.Management.Automation.CredentialAttribute()]$Credential
    Also, your invoke-command line has a typo:
    Powershell$Obj = Invoke-Command -ComputerName $ComputerName -Credential $Credential -ScriptBlock $ScopeSo all that aside, manage-bde has a -cn parameter for remote computers, so Invoke-Command may not be necessary.

    I found two scripts to get BitLocker Encryption status but my challenging are1) enable PSremoting on all laptops --best way is via GPO or any other way to do it?2) I want to run this on a few hundreds laptops so I don't want to manually enter my credentials
    TextFunction Get-OSCBitlockerStatus{ param ( [Parameter(Mandatory = $False, Position = 0)] [String[]]$ComputerName, [Parameter(Mandatory = $False, Position = 1)] [String]$FilePath, [Parameter(Mandatory = $False, Position = 2)] [system.Management.Automation.PSCredential]$Credential ) If($ComputerName) { Foreach($CN in $ComputerName) { GetStatus -ComputerName $CN } } ElseIf($FilePath) { #Get content from the file If(Test-Path -Path $FilePath) { $CNCol = Get-Content -Path $FilePath Foreach($CN in $CNCol) { GetStatus -ComputerName $CN } } Else { Write-Error "Find the specified...
    This topic first appeared in the Spiceworks Community

  • Application.Outlook error in Powershell

    Hi All,
    I am getting an error when running this:
    $var = New-Object -ComObject Application.Outlook
    Error:
    New-Object : Retrieving the COM class factory for component with CLSID {00000000-0000-0000-0000-000000000000} failed
    due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
    At line:1 char:8
    + $var = New-Object -ComObject Application.Outlook
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ResourceUnavailable: (:) [New-Object], COMException
    + FullyQualifiedErrorId : NoCOMClassIdentified,Microsoft.PowerShell.Commands.NewObjectCommand
    I am running Powershell 3.0, Office 2013 x64, on Win 8 x64.
    I tried both combinations of running PS and Outlook as Local and Admin, but got error in both.
    I am running an x64 environment for PS.
    Do i need to have x86 Outlook for this? or Do i need to install any cmdlets for outlook access from PS??
    Thanks in advance! :)

    From what I can see from :
    http://blog.pluralsight.com/powershell-to-read-emails
    and
    http://blogs.msdn.com/b/jmanning/archive/2007/01/25/using-powershell-for-outlook-automation.aspx
    your issue is that you're calling the com object with the name the wrong way round. It should be Outlook.Application, not Application.Outlook.

  • How to Install Integration service from hyper-v host to a virtual machine ?

    i have around 100 Virtual Machine distributed on a cluster hyper-v cluster so i need to know how to install the upgraded version of integration service from the hyper-v host to all  virtual machines
    that has a mismatched version of the integration service using power-shell script ?

    See this article:
    PowerShell Script
    for Automated Install of Hyper-V Integration Services in a VM running on Windows Server 2012 with Hyper-V V 3.0 Role using PowerShell Remoting
    Mike Crowley | MVP
    My Blog --
    Planet Technologies

  • How can i use azure cmdlets in scom management pack scripts

    i want to show some of azure web site metrics in the scom console so i have script which gets the data from azure portal 
    how can i use that script in the scom management pack 
    [void][system.reflection.Assembly]::LoadFrom(“C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Automation\Microsoft.WindowsAzure.Common.dll”)
    $value=Get-AzureWebsiteMetric -Name "openemrmysql" -MetricNames "Http2xx" -TimeGrain "PT1M"
    $API = New-Object -ComObject "MOM.ScriptAPI"
    $PropertyBag = $API.CreatePropertyBag()
    $result=$value.Data.Values
    foreach($result in $value)
    $global:totalvalue=$result.value.Total -as [int]
    $PropertyBag.AddValue("AzureActive","AzureActive")
    $PropertyBag.AddValue("Active", $global:value)
    $PropertyBag
    i have included this script in the management pack and it is not creating any counter in the scom console.
    Can any one help me,
    thanks & Regards,
    Suresh Gaddam

    Hi,
    I would like to suggest you check articles below to get more information about PowerShell Scripts in a Management Pack:
    http://blogs.technet.com/b/brianwren/archive/2008/02/20/running-powershell-scripts-from-a-management-pack.aspx
    http://blogs.technet.com/b/brianwren/archive/2009/06/04/powershell-scripts-in-a-management-pack-part-2.aspx
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • Hyper-V Failover Cluster Migration

    We currently have two Dell VRTX boxes, one in production, and one not (yet).  The new one is running Server 2012 R2 and the production system is running Server 2012.  I have read all of the documentation on migrating the cluster to the new servers,
    but what I want to do is a little different.  I want to upgrade the existing blade servers to R2.  I'm not actually worried about migrating the VM's themselves.  Does anyone know if it is possible to move the cluster roles to the new server,
    upgrade the existing servers to R2, then move the roles back, and start up the VM's again.  The VM storage wouldn't change at all, and we would obviously be down while we are upgrading the current servers to R2.  The goal is to avoid moving the terrabytes
    of data to a temporary location, just to move it back.  It would take longer to transfer the data than install the new OS.
    Any thoughts or comments would be appreciated.  Thank you.

    Hi RTat10,
    You can migrate your 2012 cluster vms to 2012r2 cluster, then upgrade your current 2012 node, then add this nodes back to 2012r2 cluster, last evict the new 2012r2
    nodes. You can refer the following KB to performing the migrate.
     Migrate Cluster Roles to Windows Server 2012 R2
    http://technet.microsoft.com/en-us/library/dn530779.aspx
    More information:
    1. TechEd session - http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B331#fbid=?fbid
    2. “Hyper-V Cluster Using Cluster Shared Volumes (CSV) Migration” - http://technet.microsoft.com/en-US/library/dn486822.aspx
    3. “PowerShell Script for Automated Install of Hyper-V Integration Services” -
    http://social.technet.microsoft.com/wiki/contents/articles/14295.powershell-script-for-automated-install-of-hyper-v-integration-services-in-a-vm-running-on-windows-server-2012-with-hyper-v-v-3-0-role-using-powershell-remoting.aspx
    I’m glad to be of help to you!

  • New-PSDrive to SharePoint Office 365

    How can I create a New-PSDrive to an instance of Office 365 over WebDAV?
    I know I can do it by using the map network drive in the Windows Shell (then specyfing connect to Web site).
    Just passing -Credentials into New-PsDrive does not work, I believe because Office 365 requires passing SAML tokens.
    Please help.
    Thx,
    Adam

    There is a comprehensive example of drive mapping to Office 365 with Powershell including the automation of Internet Explorer to perform the authentication here
    office365drivemap.codeplex.com
    Myles Jeffery | Thinkscape Limited
    Map network drives to OneDrive for Business and SharePoint Online document libraries - Reliably
    Try Our File Share Migration Tool for OneDrive for Business and SharePoint Online Office 365

  • Can Tiered Storage be created within VMs?

    I have a Server 2012 R2 cluster.
    I plan to create a shared cluster volume that uses SSD drives.  This shared cluster volume would then have the usual VHDX files for the VMs.
    My desire was for one VM to use tiered storage that would be comprised of one ordinary virtual drive and another virtual drive that resided on the SSD shared cluster volume.
    To test the concept I created a VM with two virtual hard drives, but when I use the wizard the tiered storage option is not available with a message saying that it must have a hard drive and a SSD drive.  So it will not do it.
    Is there a way to get around this?  Would power shell do it?
    Thanks for any help.

    I have a Server 2012 R2 cluster.
    I plan to create a shared cluster volume that uses SSD drives.  This shared cluster volume would then have the usual VHDX files for the VMs.
    My desire was for one VM to use tiered storage that would be comprised of one ordinary virtual drive and another virtual drive that resided on the SSD shared cluster volume.
    To test the concept I created a VM with two virtual hard drives, but when I use the wizard the tiered storage option is not available with a message saying that it must have a hard drive and a SSD drive.  So it will not do it.
    Is there a way to get around this?  Would power shell do it?
    Thanks for any help.
    You can do it. Can have some issues with reporting virtual disks as "spindle" or as "flash" but that's doable with PowerShell. See:
    Automated Tiered Storage with Windows Server 2012 R2
    http://blogs.technet.com/b/keithmayer/archive/2013/09/13/step-by-step-build-an-automated-storage-tiers-lab-with-windows-server-2012-r2-and-powershell.aspx#.UzPMgfl_uSo
    "Well, if the Windows Server 2012 R2 guest operating system doesn’t see these disks as “SSD” and “HDD”
    disks, it won’t know how to tier storage properly across them.  And, that’s where PowerShell comes in! Using PowerShell 4.0 in Windows Server 2012 R2, we can create a new Storage Pool and specifically tag the 250GB virtual hard disks with an SSD media
    type and tag the 500GB virtual hard disks with an HDD media type.  This will allow us to build a tiered storage lab environment with "simulated" SSD and HDD tiers. "
    Also similar question asked (and answered) recently here on TechNet forums, see:
    Storage Pool Media Type Unknown
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/cd9b0db9-72db-436a-874f-028c0cb1dcde/storage-pool-media-type-unknown
    Hope this helped :)
    StarWind VSAN [Virtual SAN] clusters Hyper-V without SAS, Fibre Channel, SMB 3.0 or iSCSI, uses Ethernet to mirror internally mounted SATA disks between hosts.

  • Automator: load webpage fully and open all links?

    Hi,
    In addition to this script: Applescript/Automator - Open all links on a webpage I'm able to open all links on a website, but I'm trying to open all links on a fancy website that keeps loading if I keep scrolling to the bottom and/or click on show more posts. I've tried loading my website fully, but automator only detects the "first page" of it. Don't know if that makes sense.
    Tried to save it as a web archive from Safari, but that doesn't do the trick, I just get an error and it doesn't detect any links... unless I'm doing something wrong. 
    Current workflow:
    Get Current Webpage from Safari
    Extract URLs from Text
    Get Link URLS from Webpages
    Filter URLs
    Run AppleScript

    You can use the SearchReset extension to reset some preferences to the default values.
    *https://addons.mozilla.org/firefox/addon/searchreset/
    Note that the SearchReset extension only runs once and then uninstalls automatically, so it won't show on the "Firefox > Add-ons" page (about:addons).
    If you do not keep changes after a restart or otherwise have problems with preferences, see:
    *http://kb.mozillazine.org/Preferences_not_saved

  • Alternatives to PowerShell automation of Excel (Scheduled Task) in a Windows Server 2012 R2 world

    I have a handful of PowerShell scripts that ran as Scheduled Tasks on an old Windows 2008 SP2 server, which output reports as Excel workbooks with multiple worksheets, via a COM object. After migrating these scripts to a new Windows 2012 R2 server,
    these scripts no longer function. The Server 2008 system was running Office 2007, and the new Server 2012 R2 server has Office 2013 installed.
    What is everyone using on their Server 2012 R2 systems to automate generation of multi-sheet reports in Excel via PowerShell and Scheduled Tasks?
    I know that Microsoft has said that automating Office applications server-side in non-interactive mode, but it has worked in the past, until now. (https://support.microsoft.com/kb/257757)
    I've tried the OpenXML PowerTools for PowerShell (https://powertools.codeplex.com/), but Export-OpenXMLSpreadsheet will only export a single worksheet, and they don't support adding worksheets to existing files
    (am I missing something?). I understand the OpenXML PowerTools can be extended in C#, but I don't C#. The PowerShell cmdlets were released in Jan 2012, but don't look to have been updated since then (updates have been the core C# code).
    I've seen recommendations to add C:\Windows\(System32 or SysWOW64)\config\systemprofile\Desktop, but this hasn't worked on Server 2012.
    Has anyone been able to get Excel 2013 to cooperate on Server 2012 R2, or come up with a suitable alternative? I'd rather not start running these scripts from my workstation.
    EDIT:
    I'm not necessarily looking for an Excel answer, since there are OpenXML ways of doing things now without the Excel application.
    Here are some of the errors I'm getting when approaching this from different directions. When I use:
    $excel = New-Object -comobject Excel.Application$workbook = $excel.Workbooks.Add()
    Results in error:
    Exception calling "Add" with "0" argument(s): "Microsoft Excel cannot open or
    save any more documents because there is not enough available memory or disk
    space.
    • To make more memory available, close workbooks or programs you no longer
    need.
    • To free disk space, delete files you no longer need from the disk you are
    saving to."
    At C:\path\to\script.ps1:21 char:2
    + $workbook = $excel.Workbooks.Add()
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation
    The server is definitely not lacking for resources.
    I can copy a blank XLSX file and use .Open($xlFile) instead of .Add(), but then when I go to open a CSV file to copy/paste the content to a worksheet, I get this one:
    Exception calling "Open" with "1" argument(s): "The server threw an exception.
    (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"
    At C:\path\to\script.ps1:65 char:2
    + $tempcsv = $excel.Workbooks.Open($CSVFile)
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation
    Things that I've tried so far, with no success:
    I created C:\Windows\System32\config\systemprofile\Desktop and C:\Windows\SysWOW64\config\systemprofile\Desktop as suggested here:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/0751119d-84d5-4a77-8240-1c4802f97375/powershell-scheduled-tasks-wont-start-excel?forum=winserverpowershell
    Add Local Launch and Local Activation permissions to the Microsoft Excel Application DCOM Config, Grant "Read & Execute, List folder contents, Read" permissions on the \config\systemprofile\Desktop folder. Grant "Modify, Read & Execute,
    List Folder Content, Read, Write" permissions for the account on the following folders:
    \config\systemprofile\AppData\Roaming\Microsoft
    \config\systemprofile\AppData\Local\Microsoft
    as suggested here:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/aede572b-4c1f-4729-bc9d-899fed5fad02/run-powershell-script-as-scheduled-task-that-uses-excel-com-object?forum=winserverpowershell
    @ jrv - I will try posting a similar question in the Excel 2013 forum, but since I'm looking for a scripting solution to produce an OpenXML spreadsheet, and not something that necessarily uses the Excel application (though such a solution would not be turned
    away), I thought this the more appropriate venue.
    (to reiterate from OP) I have seen and acknowledge Microsoft's statements regarding the unsupported nature of automating Office applications in non-interactive environments, but the truth of the matter is, supported or not, it worked in the past (Server
    2008), it's what I inherited from my predecessor, and I know I'm not the only one who has been using Excel in this way. I'm only asking fellow scripters, some of whom must also be using Excel in this "unsupported" fashion, how they are automating
    creation of their spreadsheet reports after moving to Server 2012. A different system modification to make the Excel comObject continue working as before? Direct manipulation of the OpenXML document? Other solutions that may or may not require launching the
    Excel application?

    #1 - Ask in Excel 2013 forum.
    #2 - Microsoft has repeatedlynoted that this is NOT a supported configuration for Office products.
    #3 - What errors are you getting?
    #4 - What have you done to debug this:
    #5 - No one can be of much help unless you post a very simple example of how this fails.
    ¯\_(ツ)_/¯

  • Does anyone know how to save multiple webpages in safari using automator?

    Does anyone know how to save multiple webpages in safari using automator?

    You will likely get better program help in a program forum
    The Cloud forum is not about using individual programs
    The Cloud forum is about the Cloud as a delivery & install process
    If you will start at the Forums Index https://forums.adobe.com/welcome
    You will be able to select a forum for the specific Adobe product(s) you use
    Click the "down arrow" symbol on the right (where it says All communities) to open the drop down list and scroll

  • Saving webpages as pdf and/or png in a batch manner? w/ Automator perhaps?

    I have some old livejournals that I'd like to archive in some way. A long time ago for one of them, I used Paparazzi to create .png's for every single day's entries. This was slow but it got the job done. For another more recent endeavor with another journal, I was doing the same thing however then I saw the .pdf functionality. I thought, perhaps pdf's would be more useful because they are searchable, although in some ways I like having a plain png as almost a backup to the backup. I realized that I might want to go back to the other journal (which has like 9 years of content) and re-capture it into .pdf and do the same for this newer one... but I will not be taking the time to do this one by one again.
    I tried Automator but Paparazzi apparently doesn't have Universal commands even though it has commands within Automator.
    So I need another solution, with or without Paparazzi, that will allow me to at the least just type in all the urls (which will only be off by a digit or two for dates, thus saving time overall) and then letting it batch capture into a .pdf or .png.

    I appreciate the tip, however it doesn't seem to be efficient. I downloaded and installed it, then I ran this sequence.
    Get Current Webpage from Safari
    Download URLs as PDFs (downloads file as a number for the day)
    Add Text to Finder Items Names (Month- gets added before number)
    Add Text to Finder Items Names (Year- gets added after number)
    So this works... but only once. The program needs to be closed and re-opened as a workflow for it to download a webpage again properly. It'll create just blank white pdf's otherwise. Then if I make it a stand alone application it gives me an error about it not being universal.
    A shame but I appreciated the help.
    Does anyone else have any ideas???

  • Find text in webpage and email notification applescript/automator

    Hey guys, I'm trying to make (what I think is) a fairly complicated automator/applescript action.  Basically, I'm trying to buy a certain product and it is only available on the webpage at certain times. So I want to create a function that will constantly run in the background on my computer. I want this function to reload a safari page every 10-15 minutes (the one with the store's product page), search for text (the name of the product) and either stop there if the text isn't found or if the text is found, open mail and send myself an email notification so that I'll get it on my phone if the product becomes available. Is this possible at all?

    this might do what you're looking for:
    on idle
              set pagURL to "http://page.url.com?whatever"
              if application "Safari" is not running then
                        quit
                        return
              end if
              tell application "Safari"
                        set URL of document 1 of window 1 to "http://your.web.address/"
                        delay 5
      -- delay to let page load. 
      -- there are more elegant ways of doing this using do javascript, but this will suffice.
                        if source of document 1 of window 1 contains "search text" then
                                  my sendAMail()
                        end if
                        return 900 --fifteen minutes
              end tell
    end idle
    on sendAMail()
              tell application "Mail"
                        set theMess to make new outgoing message at end with properties {sender:"your name", subject:"some subject line", content:"The message you want to send to yourself", visible:true}
                        tell theMess
                                   make new to recipient at end of to recipients with properties {address:"[email protected]"}
                        end tell
      -- send theMess
              end tell
    end sendAMail
    copy it into the applescript editor, edit in all the correct information about the web page, your email address, etc., then save it as a stay open application.  when run, it will periodically reload and check the page - adjust the number after the return statement to set it to different time periods.
    test it first, then when you're ready to use it set visible:false in the line where you make the message, and uncomment the send theMess line.  this will get mail to make and send the message invisibly.

  • Release Management vNext Powershell Could not load file or assembly System.Management.Automation Version=3.0.0.0

    Hi,
    I'm running TFS2013.4 with a number of build servers and all working fine. 
    I'm also running Release Management with update 4 (12.0.31101.0) and am running into trouble when trying to run my first dummy release.
    I have setup my servers, stages, releases paths, components and release template (all vNext) with out issue.
    When I run my Release Template (Deploy Using PS/DSC) I'm getting the following error :-
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.AggregateException: One or more errors occurred. ---> System.IO.FileNotFoundException:
    Could not load file or assembly 'System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
    The system cannot find the file specified.
       at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.PowershellExecutor.DisposeCurrentSession()
       at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.RemoteDeploymentHelper.Dispose()
       at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.<RunAsync>d__11.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.VisualStudio.Services.DevTestLabs.Deployment.Deployment.DeploymentClient.<RunPowerShellAsync>d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.<CopyBuildsLocally>d__5.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.TeamFoundation.Release.EnvironmentProvider.OnPrem.Implementation.OnPremDeploymentProvider.<RunScript>d__0.MoveNext()
       --- End of inner exception stack trace ---
       at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
       at Microsoft.TeamFoundation.Release.MonitorServices.Dsc.OnPrem.OnPremDeploymentActions.InvokePlatform(String activityId, MachineSpecification machineSpecification, StorageSpecification storageSpecification, String scriptPath, String configurationPath,
    Dictionary`2 configurationVariables)
       at Microsoft.TeamFoundation.Release.MonitorServices.Dsc.OnPrem.OnPremDeploymentActions.RunScript(DscComponent dscComponentParameters, String serverName, String userName, String password, String componentName, String scriptPath, String configurationPath,
    String useCredSecuritySupportProvider, String useHttps, String skipCACheck)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Microsoft.TeamFoundation.Release.DeploymentAgent.Services.Deployer.Dsc.DscComponentInstaller.InvokeMethodByReflection(String methodArguments)
    I can't work out if my target machine (2008 R2 SP1) has a problem with WMA 3.0 or if the Release Template can't find the powershell script that I'm trying to call.  I figured that the relative path to the script could be wrong and have tried numerous
    iterations to no effect.  The error clearly points to a problem with WMA right?
    The target machine has .Net Framework 4.0, WMA Framework 3.0 and I can run Enter-PSSession to remote to it etc...
    Before I trash and rebuild my target machine I hoping someone may have some insight to my problem?
    Thanks in Advance
    Jason
    shroomie

    Daniel,
    The PS Script is taken from an MSDN blog and is fairly standard.  I'm sure it will run fine when executed, but I've not run it as it requires environment variables ($applicationPath) that will be present in the Release Management session calling it. 
    Here's the script :-
    configuration InstallModules
        param
            # Target nodes to apply the configuration
            [string[]]$NodeName = 'localhost',
            # Source Path for Modules
            [String]$SourcePath = "$applicationPath\Deploy\Modules",
            # Destination path for Modules
            [String]$DestinationPath = "$env:ProgramFiles\WindowsPowershell\Modules"
        Node $NodeName
            # Copy the Modules
            File ModuleContent
                Ensure          = "Present"
                SourcePath      = $SourcePath
                DestinationPath = $DestinationPath
                Recurse         = $true
                Type            = "Directory"
    InstallModules
    Thanks
    Jason
    shroomie

  • Hyper-V BPA Automation with Powershell

    "draft" version of simple powershell script for Hyper-V BPA automation
    I'm not a pro in PS. I'll be happy to hear your comments and advices
    Anyway, I hope it will be useful for somebody. 
    http://rlevchenko.com/2014/05/02/hyper-v-bpa-automation-with-powershell/
    Roman Levchenko, MCSA, MCITP, MCTS http://www.rlevchenko.com

    Hi ,
    I am not familiar with powershell .
    #create Backup Path of the Day
    $path = new-item -ItemType Directory -Path "$rootPath\$(Get-Date -f yy_MM_dd_HH-mm)"
    I think it will create a new folder to store the export image when the script start to run .
    Also the disk space for storing these image is a factor what you can think of .
    Best Regards
    Elton Ji
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

Maybe you are looking for

  • How to integrate multiple applications for single project as single appl

    Hi, I'm struggling to find out about that how to combine all the applications developed by my team members. We all created each application having many pages, how to combine all this pages to create as a single appl. Can anyone please tell me how to

  • DVD not working properly when played on DVD player

    I created a DVD using FCP and DVDSP, it plays fine on my Mac and my regular DVD player. However, it plays once through on a TV Guardian DVD Player and then will not play again. I don't know much about these players but they filter foul language and s

  • White screen/black screen..help!

    Flashplayer was working but I am having a problem tonight. I am getting a white screen on TV channels and black on you tube. BBc iplayer has a loading wheel all other channels are white. You Tube is black and says error and other videos ie on Faceboo

  • Can PC send/receive texts/calls via iPhone 5?

    My iPhone 5 has poor reception where my computer is located.  Can I leave the iPhone elsewhere in the house where there is better reception and send/receive texts and calls remotely via my (Win 7) PC?  If so, how? Thanks, Ron

  • Can Developer 6i(Forms and Reports) be installed on Vista

    Can Developer 6i(Forms and Reports) be installed on Vista?? If yes, then which version? Please answer..........