Powershell script with list view

Hi,
I have a scheduled job in SharePoint 2013 environment, where I export SharePoint list Items as csv. I would like to use a SharePoint list View so that I get all the items from the view into csv. I tried below
script and it only returns items that are in the first paginated view. The view has an item limit of 50 items. But I wan't to return all the items in the view. 
Please help me modify the script accordingly. Thank you.
#Retrieving the Web Site with List
$MyWeb = Get-SPWeb "http://mysite/sites/testsite"
#Get the List name
$MyList = $MyWeb.Lists["Programs"]
#Get The View
#Change the name of the view
$MyView = $MyList.Views["My View"]
#Get the Items from the view
$MyItems = $MyList.GetItems($MyView)
#Get Specific field items and export it to a csv file
$MyItems | %{ select-object -input $_ -prop @{Name='ID';expression={$_.ID;}}, 
@{Name='Content Type';expression={$_["P. Type"];}}, 
@{Name='Program Name';expression={$_["Program Name"];}},
@{Name='Classifications';expression={($_["Classifications"]).substring(($_
["Classifications"]).IndexOf("#")+1);}},
@{Name='Classifications ID';expression={($_["Classifications"]).split(";")[0];}},
@{Name='VP';expression={($_["VP Owner"]).substring(($_["VP Owner"]).IndexOf("#")+1);}},
@{Name='VP ID';expression={($_["VP Owner"]).split(";")[0];}},
@{Name='Project Manager';expression={$_["Project Manager"];}},
@{Name='GL Project Code';expression={$_["GL Project Code"];}}, 
@{Name='Segment BU';expression={($_["Segment BU"]).substring(($_["Segment BU"]).IndexOf
("#")+1);}}, 
@{Name='Segment BU ID';expression={($_["Segment BU"]).split(";")[0];}},
@{Name='C-Product Line';expression={$_["C-Product Line"];}}, 
@{Name='Node and Foundry';expression={($_["Node and Foundry"]).substring(($_["Node and 
Foundry"]).IndexOf("#")+1);}},
@{Name='Node and Foundry ID';expression={($_["Node and Foundry"]).split(";")[0];}},
@{Name='Phase';expression={$_["Phase"];}}, 
@{Name='Program Activity';expression={$_["Program Activity"];}}, 
@{Name='Archive';expression={$_["Archive"];}}; } | Export-Csv -Path "c:\Dashboard.csv"
techie

Hi CoolTechie,
Rather than writing a batch job to populate excel timely fashion, I will suggest to make a excel data source auto-refresh after every minute, which is more real time. That excel can be shared as well.
You can use the Excel as external data source, you
can set refresh the excel per 1 minute.
The steps of configuration, you can refer to the following
link.
http://sharepointlink.blogspot.com/2010/08/sharepoint-2010-excel-services-and.html
Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

Similar Messages

  • Which is better approach to manage sharepoint online - PowerShell Script with CSOM or Console Application with CSOM?

    Which is better approach to manage sharepoint online - PowerShell Script with CSOM or Console Application with CSOM?
    change in sharepoint scripts not require compilation but anything else?

    Yes, PowerShell is great, since you can quick change your code without compilation.
    SP admin can write ps scripts without specific tools like Visual Studio.
    With powershell you can use cmdlets,
    which could remove a lot of code, for example restarting a service.
    [custom.development]

  • What is the best way to run a powershell script with parameters in the Task Scheduler?

    Hello, 
    Want to run the following from a scheduled task in the Task Scheduler on a server.  What is the best approach?
    .\pscript.ps1 -csvfile "\\Srv1\Share\File.txt"
    Thanks for your help! SdeDot

    Hi,
    To run a powershell script with parameters in the Task Scheduler:
    Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    Add argument (optional): -Command "& c:\scripts\test.ps1 -par1 2 -par2 3"
    Hope the below two articles be helpful for you:
    Schedule PowerShell Scripts that Require Input Values
    https://blogs.technet.com/b/heyscriptingguy/archive/2011/01/12/schedule-powershell-scripts-that-require-input-values.aspx
    How to Schedule a PowerShell Script
    http://dmitrysotnikov.wordpress.com/2011/02/03/how-to-schedule-a-powershell-script/
    Regards,
    Yan Li
    Regards, Yan Li

  • PowerShell script to list ALL documents bigger than 10MB - in list attachments/libraries all over my site?

    Hi there,
    Just wondering if someone can give me the PowerShell script to list ALL documents bigger than 10MB - in list attachments/libraries all over my site?
    Really appreciated.
    Thank you.

    Hello,
    here you can find sample to help you create yoru script :
    http://sharepointpromag.com/sharepoint/windows-powershell-scripts-sharepoint-info-files-pagesweb-parts
    see this sample extract from this site
    Get-SPWeb http://sharepoint/sites/training |
                                     Select -ExpandProperty Lists |
                                     Where { $_.GetType().Name -eq "SPDocumentLibrary" -and
                                             -not $_.Hidden }
    |
                                     Select -ExpandProperty Items |
                                     Where { $_.File.Length -gt 5000 } |
                                     Select Name, {$_.File.Length},
                                            @{Name="URL";
                                            Expression={$_.ParentList.ParentWeb.Url
    + "/" + $_.Url}}
    this can help too :
    https://gallery.technet.microsoft.com/office/Get-detail-report-of-all-b29ea8e2
    Best regards, Christopher.
    Blog |
    Mail
    Please remember to click "Mark As Answer" if a post solves your problem or
    "Vote As Helpful" if it was useful.
    Why mark as answer?

  • Cannot create mysites from powershell: Original XSLT List View Web Part not found

    I have a bizarre problem in my SharePoint 2013 farm. This does not occur in my test farm, only in the farm we were going to go live with.
    I'm on windows Server 2012, SQLServer 2012 SP1, SharePoint 2013 April CU. 1 appserver/centraladmin server, 2 web servers.
    When I log into our mysitehost and click newsfeed, it will create a mysite (even though first it displays "we are sorry there was a problem creating your site")
    But from powershell, whether I use $UserProfile.CreatePersonalSite() or New-SPSite, I get the following error:
    Original XSLT List View Web Part not found
    So far I've only found one other person with this:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2503e42c-e114-4e89-8e00-89fe70f0b154/cannot-create-sharepoint-mysite-programmatically
    This is a brand new farm, created with the same scripts I created my test farm with, and same version of SharePoint. Only the service accounts are different. (Farm account has admin on the servers right now since I was setting up profile service).
    Some other errors from the same correlation ID that look related:
    It can't seem to find the listemplate 101
    And something looks wrong with the MySiteDocumentLibrary feature
    I have tried the following:
    1. run psconfig.exe on each server
    2. install-spfeature -AllExistingFeatures
    3. looped through the directory under Features and for each called Install-SPFeature $dirname -Force
    4. uninstalled and reinstalled MySiteDocumentLibrary feature
    5. blew away the whole farm (removed all servers from farm, deleted all databases) and recreated it.
    6. tried creating the UPA from the CentralAdmin gui.
    The only real difference I can think of between the working farm and non working farm is, I installed the working farm using RTM, then as they came out added the March PU and April CU. For this farm I installed RTM and March and April, and then ran my build
    farm script.
    I am at a loss. What do I need to do, re-install the binaries? That's all I can think of. What I love is that our test / POC system worked fine, and now 2 weeks before go-live I'm seeing errors on the production servers I've never seen before. Using the
    same scripts no less.
    Feature Activation: Feature 'Fields' (ID: 'ca7bd552-10b1-4563-85b9-5ed1d39c962a') was activated
    Feature Activation: Feature 'CTypes' (ID: '695b6570-a48b-4a8e-8ea5-26ea7fc1d162') was activated
    No document templates uploaded for list "$Resources:core,global_onet_solutiongallery_list;" -- none found for list template "100"
    Failed to find <ListTemplate> tag corresponding to ID "101", tried both onet.xml for site definition ID "0" language "1033" and global site definition. Operation failed.
    No document templates uploaded for list "$Resources:core,stylelibraryList;" -- none found for list template "121".
    System.Runtime.InteropServices.COMException: A user may not remove his or her own account from a site collection.<nativehr>0x81020051</nativehr><nativestack></nativestack>, StackTrace: at Microsoft.SharePoint.SPUserCollection.UpdateMembers
    Feature Activation: Feature 'MySitePersonalSite' (ID: 'f661430e-c155-438e-a7c6-c68648f1b119') was activated
    Feature Activation: Activating Feature 'MySiteDocumentLibrary'
    Calling 'FeatureActivated' method of SPFeatureReceiver for Feature 'MySiteDocumentLibrary'
    SharePoint Foundation Upgrade MySiteDocumentLibraryFeatureReceiveraj08n INFO Creating new My Documents library
    Unknown SPRequest error occurred. More information: 0x80070002
    SPRequest.GetMetadataForUrl: UserPrincipalName=, AppPrincipalName= ,bstrUrl=http://contoso/personal/cbuchholz/DOCUMENTS ,METADATAFLAGS=59
    System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>, StackTrace: at Microsoft.SharePoint.SPWeb.GetObjectForUrl at Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryUtil.GetSPObjectFromUrl ...
    <nativehr>0x80070002</nativehr><nativestack></nativestack>There is no Web named "/personal/cbuchholz/DOCUMENTS"
    Possible mismatch between the reported error with code = 0x81070504 and message: "There is no Web named "/personal/cbuchholz/DOCUMENTS"." and the returned error with code 0x80070002.
    Attemping to add webpart id 0F6072F2-E804-4CFD-837E-BB37332B9D1C to web http://contoso/personal/cbuchholz
    Adding XsltListViewWebPart calling SPRequest::CreateListViewPart. Web part id 0F6072F2-E804-4CFD-837E-BB37332B9D1C, web http://contoso/personal/cbuchholz
    Feature receiver assembly 'Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c', class 'Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryFeatureReceiver', method 'FeatureActivated' for feature 'e9c0ff81-d821-4771-8b4c-246aa7e5e9eb' threw an exception: System.InvalidOperationException: Original XSLT List View Web Part not found at Microsoft.SharePoint.Portal.UserProfiles.MySiteDocumentLibraryUtil.ReplaceListViewWebPart
    Feature Activation: Threw an exception, attempting to roll back. Feature 'MySiteDocumentLibrary'
    Exception in EnsureFeaturesActivatedAtSite: System.InvalidOperationException: Original XSLT List View Web Part not found
    Failed to activate site-collection-scoped features for template 'SPSPERS#2' in site collection 'http://contoso/personal/cbuchholz'
    Failed to apply template "SPSPERS#2" to web at URL "http://contoso/personal/cbuchholz
    I've had other problems in this farm: the bug where when you add Administrators to a Search Service via the Manage Service Applications page, it removes the SPSearchDBAdmin role from the search service process account. That one did not happen in the other farm.
    At least other people have that one and I could just use the farm admin instead (still troublng of course).

    Ok,
    Here is the problem:
    When creating a mysite from powershell or script, apparently you can ONLY do this from a wfe (or a server running Microsoft SharePoint Foundation Web Application in services on server).
    You CANNOT create mysites from script on your appserver if it is not also a Web Application Server. I confirmed the same is true in my test farm. I guess I was always running most of these scripts on the webserver.
    I searched all over and cannot find this documented anywhere.
    Who do I contact to have Microsoft document this?
    It's Thursday morning, I've been working non stop since Saturday morning so you don't have to :)

  • Update a filed value with powershell script with ordery by and where condition

    Hi
    I have below powershell script to update list columns but  how i update a field value with ordery by a column and where condition
    below is the part of my script
    $list = $web.Lists[$listName]
    $items = $list.items
    $internal_counter = 1
    #Go through all items
    foreach($item in $items)
    if($item["CourtNO"] -eq $null)
    #if($item["CourtNo"] -eq '1')
    $item["CaseNo"] = $internal_counter
    #how to add a column ordery by Title
    # and where Title field value from 1 to 10
    $internal_counter++
    adil

    Hi,
    You mean that you only need to update all items with Title field value in range 1..10 and order by them before run the loop statement update?
    If so, use CAML query to get the items only match the condition.
    #Build Query
    $spQuery = New-Object Microsoft.SharePoint.SPQuery
    $query = '<Where><And><Gte><FieldRef Name="Title" /><Value Type="Text">0</Value></Gte><Lte><FieldRef Name="Title" /><Value Type="Text">10</Value></Lte></And></Where><OrderBy><FieldRef
    Name="Title"/></OrderBy>'
    $spQuery.Query = $query
    $spQuery.RowLimit = $list.ItemCount
    $items = $list.GetItems($spQuery)
    Hope this help!
    /Hai
    Visit my blog: My Blog | Visit my forum:
    SharePoint Community for Vietnamese |
    Bamboo Solution Corporation

  • Weird happenings with list view in OS 10.3.9--one folder only.

    Hello,
    OK, this one strikes me as odd. In one of my folders on the Desktop, when I click list view, it doesn't behave normally. Instead of the regular list view, with the clickable headings on top (Name, Kind, Size, Date created, etc.), only the subfolders show up and on the top is just some nonclickable random stuff, sometimes left over if I've switched over from Column view. I think the best way to "explain" would be to show some screenshots, so I hope I can link these correctly:
    In column view, which is normal:
    http://smg.photobucket.com/albums/v284/movingsale/screenshots/?action=view&curre nt=nyufolder_columnview.jpg >
    In list view after column view:
    http://smg.photobucket.com/albums/v284/movingsale/screenshots/?action=view&curre nt=nyufolder_listview.jpg
    In list view from a closed folder:
    http://smg.photobucket.com/albums/v284/movingsale/screenshots/?action=view&curre nt=nyufolder_listview2.jpg
    I'm sorry I put these as links--I don't know how to put the actual pics in my post. Some more information:
    This only started happening within the last 2 weeks or so, but it happens every time I open this folder off the desktop. As far as I've seen, it doesn't happen on any other folders. I have an external drive that I use for a bootable clone, and it happens on the cloned version of the folder, too. It even happens on an old cloned version of the folder, which I think is from before this started happening.
    I guess my question is, what would cause this, and is it a sign of impending doom, or should I not worry about it?
    Thanks in advance!
    Anna

    Hi Anna,
    I suspect the viewing information for this folder is bad. It is unlikely that there is anything more wrong. I think you can fix it by:
    1. make a new folder with a slightly different name than the bad one.
    2. In some view other than list, move all the contents of the bad folder to the new one.
    3. Trash the bad folder.
    4. Rename the new folder to the name of the one you treashed.
    Does this fix the problem?
    Frank

  • Using xsl stylesheet with List View Web Part to display custom text

    Hi 
    i have an xsl stylesheet with sharepoint listview webpart. The list view shows some items based on a filter. I want to display custom text such as "No Items" when there are zero items in the list view using the xsl stylesheet. How do i achieve
    this. I have spent hours searching but couldnt find the exact answer. Please help me out. I am a light user not a hard core developer so I dont use Visual Studio. Thanks in advance

    Hi 
    I have customised the list view webpart using a custom xsl file by including it in the xsl link of the list view webpart. So i think i need to include the condition in the xsl file itself else it wont work. Since the list view webpart isnt using the default
    xsl. Please let me kknow if you have any idea about including a condition in xsl to check if there are not items in view. 
    The code of the xsl is included below.
    <!--
    This section is the set up and can be used at the top of any external XSLT stylesheet file
    -->
    <xsl:stylesheet
    xmlns:x="http://www.w3.org/2001/XMLSchema"
    xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
    version="1.0"
    exclude-result-prefixes="xsl msxsl ddwrt"
    xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
    xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
    xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:SharePoint="Microsoft.SharePoint.WebControls"
    xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema">
    <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
    <table>
    <xsl:for-each select="$Rows">
    <xsl:call-template name="dvt_1.rowview"></xsl:call-template> 
    </xsl:for-each>
    </table>
    </xsl:template>
    <xsl:template name="dvt_1.rowview">
        <tr>
      <td><img height="78" width="60"><xsl:attribute name="src"><xsl:value-of select="@Photo"/></xsl:attribute></img></td>
        <td>
        <table style="margin-left:10px;">
        <tr><td><xsl:value-of select="@FullName"/></td></tr>
        <tr><td><xsl:value-of select="@DOBinWords"/></td></tr>
        </table>
        </td>
      </tr>
    </xsl:template>
    </xsl:stylesheet>

  • Run a powershell script with domain credentials during task sequence

    I have a powershell script that adds the computer it is run on to a security group.  If I log onto the computer with a domain account it works perfectly.  However, if it is run while logged on as the local admin account it fails with an error message
    that says the domain either doesn't exist or cannot be reached.
    This is a problem because when a computer is being imaged the process runs with the local admin account.  Is there a way to run this script with domain credentials in the task sequence?
    Thanks,
    Andy

    How are you running the Powershell script? If you use a Run Command Line step, you can specify an account to run as. Something like "powershell %scriptroot%\psscript.ps1" where the psscript.ps1 is located in your Scripts folder in your deployment
    share.
    -Nick O.

  • Problem with List View in Calendar

    Hi,
    On my iPhone 4 running 4.3.3, I can't see any entries older than one year under 'list view'.  Ironically, the entries appear under Day and Month view so I know they are there, but nothing older than one year under List view.  I have tried resetting to no avail.  I sync via iTunes (not mobile me) but there is nothing that points to why only one view on my iPhone would have this restriction.  Please help.
    Thanks

    Here's a workaround that I discovered: duplicate a previous individual event that printed correctly, i.e., without the empty "Location:" line shown; then edit that information for the new event as desired -- an ugly solution, but it works!

  • Powershell Script to list pdf files in a directory

    Hey Scripting guy, I read few of your forum solutions for the scripts and was really enthralled to embrace this powershell scripting, thanks for the motivation.
    I am still a learner and want to learn more, I had to do a script on generating an excel report which consisted of number of files of files in PDF format for each directory and sub-directory in the path.
    I used the,
    get-childitem $Path -recurse | where {$_.Extension -match "pdf"}
    command, all I wanted to know is how to count the number of PDF files in each sub directory, please help me out,
    Thanks in advance

    Ok, let's have some fun :)
    function Count-FilesRecursive{
    Param(
    [parameter(Mandatory = $true, Position = 0)]
    [string]$Path,
    [parameter(Mandatory = $true, Position = 1)]
    [string]$Filter
    $SB_recursive = {
    [System.IO.Directory]::GetDirectories($args[0])|ForEach-Object {
    Try{
    $i = ([System.IO.Directory]::GetFiles($_,$Filter)).Count
    Catch [UnauthorizedAccessException] {
    $i = 0
    "{0,-10} {1}" -f $i, $_
    Try{
    $SB_recursive.Invoke($_)
    Catch [UnauthorizedAccessException] {}
    "{0,-10} {1}" -f "Number of files", "Path"
    "{0,-10} {1}" -f "---------------", "----"
    $SB_recursive.Invoke($Path)
    Count-FilesRecursive -Path C:\users -Filter '*.pdf'

  • Problems with list view

    I have several cds from an old computer that I put on my new computer and loaded them into itunes. They look fine in grid view and I can get the album art and everything but when I go to list view it doesn't put them by the album instead it might list 20 entries (or howevermany tracks there are) and separate them by tracks so basically there will be 20 album pictures of each album and they are listed by all of track 1s and then track 2s. If I delete out the track number they all list together on the list view but then of course I lost my track number and they just list alphabetically.
    Any ideas?

    Check the "artist" field for these tracks - it is likely they are different (perhaps there are guest artists, for instance Jurassic 5 featuring Nelly Furtado). If this is the case, highlight all of the tracks from an album, right-click, and choose Get Info. On the Info tab type the artist's name and click OK.
    Another possibility is these are compilation albums that contain tracks from multiple artists. If this is the case, highlight the tracks and go to Get Info (as above). Go to the Options tab and set "Part of a compilation" to Yes.

  • Running powershell script with customer parameters as a scheduled task

    tfl wrote:I guess I don't get why you are wanting thisMy regular tasks run,. and take data from data files. Want your batch to get processed today? Then add it to the queue file by 5:00 PM.. The task runs at 5:01 and works with whatever data is available. And if the file is empty, nothing happens each night. If you want to pass parameters like this, then why bother with a scheduled task? You'd need to remove the old one and add the new one each time. Which is extra work and complexity, especially if the task at hand is in any way 'dangerous' if run twice with the same data (ie you forget to change the task or remove it).I'm using a scheduled task to trigger the script, I'm using the "on event" trigger and then calling the script as an action. The method I was using before (calling via a bat file with the event Id hard coded into that"...

    Hi all,Having one of those hair pulling issues where something should work but for some reason its blindly refusing not to!I've created this script that is a bit of an extension to the email on eventID for task scheduled. It basically pulls out the various information from the actual event and fires off an email to our alerting team to investigate etc.That all works great, but what I'm now trying to do is get it to accept a custom parameter so the actual event ID its looking for doesn't have to be hard coded and can be passed to it via the commandline etc. I've got it all setup and work great but for the life of me can't get it to work correctly when set as a scheduled task. This is what the command basically looks like:powershell -executionpolicy bypass -command "& 'pathtofile\script.ps1' -evtid 8004"The latter part is the customer...
    This topic first appeared in the Spiceworks Community

  • Powershell Script Dropdown List Passes Argument to Expiration Date

    Hello,
    I am trying to configure this script so that the user has a choice to make.  If the user chooses "FTE", then the script proceeds to the next function.  If the user chooses "Contractor", he is then taken to the expiration date portion
    of the script.  How do I configure this script to flow in that manner?
    # Edit This item to change the DropDown Values
    [array]$DropDownArray = "FTE", "Contractor"
    # This Function Returns the Selected Value and Closes the Form
    function Return-DropDown {
    $Choice = $DropDown.SelectedItem.ToString()
    $Form.Close()
    #Write-Host $Choice
     $MyChoice = $Choice
     #Write-Host $MyChoice
     $Script:Choice = $DropDown.SelectedItem.ToString()
     $Form.Close()
    [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") |Out-Null
    [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") |Out-Null
    $Form = New-Object System.Windows.Forms.Form
    $Form.width = 300
    $Form.height = 150
    $Form.Text = ”User Type”
    $DropDown = new-object System.Windows.Forms.ComboBox
    $DropDown.Location = new-object System.Drawing.Size(100,10)
    $DropDown.Size = new-object System.Drawing.Size(130,30)
    $DropDown.DropDownStyle = "DropDownList" # This style of combobox will prevent blank
    # item selection.
    ForEach ($Item in $DropDownArray) {
    $DropDown.Items.Add($Item) | Out-Null # Added pipe to out-null to prevent index from
    # showing up in the console window.
    $DropDown.SelectedIndex = 0 # Select the first item by default
    $Form.Controls.Add($DropDown)
    $DropDownLabel = new-object System.Windows.Forms.Label
    $DropDownLabel.Location = new-object System.Drawing.Size(10,10)
    $DropDownLabel.size = new-object System.Drawing.Size(100,20)
    $DropDownLabel.Text = "Items"
    $Form.Controls.Add($DropDownLabel)
    $Button = new-object System.Windows.Forms.Button
    $Button.Location = new-object System.Drawing.Size(100,50)
    $Button.Size = new-object System.Drawing.Size(100,20)
    $Button.Text = "Select an Item"
    $Button.Add_Click({Return-DropDown})
    $form.Controls.Add($Button)
    $Form.Add_Shown({$Form.Activate()})
    $Form.ShowDialog() | Out-Null # out-null to prevent "OK" or "Cancel"
    # from appearing in the console window
    #Set the expiration date
    $ans=Read-Host 'What is the expiration date of this account? (mm-dd-yyyy)'
    $expDate=[datetime]$ans
    HELP Read-Host -Full
    ##End of Script
    Thanks in advance for your help.

    Here is an example of one way to do this in a form:
    [void][reflection.assembly]::Load("System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")
    [void][reflection.assembly]::Load("System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
    [System.Windows.Forms.Application]::EnableVisualStyles()
    $form1 = New-Object 'System.Windows.Forms.Form'
    $datetimepicker1 = New-Object 'System.Windows.Forms.DateTimePicker'
    $radiobuttonFTE = New-Object 'System.Windows.Forms.RadioButton'
    $radiobuttonContractor = New-Object 'System.Windows.Forms.RadioButton'
    $buttonOK = New-Object 'System.Windows.Forms.Button'
    $InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState'
    $radiobuttonContractor_CheckedChanged={
    if($radiobuttonContractor.Checked){
    $datetimepicker1.Visible=$true
    }else{
    $datetimepicker1.Visible=$false
    $Form_StateCorrection_Load=
    #Correct the initial state of the form to prevent the .Net maximized form issue
    $form1.WindowState = $InitialFormWindowState
    $Form_Cleanup_FormClosed=
    #Remove all event handlers from the controls
    try
    $radiobuttonContractor.remove_CheckedChanged($radiobuttonContractor_CheckedChanged)
    $form1.remove_Load($FormEvent_Load)
    $form1.remove_Load($Form_StateCorrection_Load)
    $form1.remove_FormClosed($Form_Cleanup_FormClosed)
    catch [Exception]
    $form1.Controls.Add($datetimepicker1)
    $form1.Controls.Add($radiobuttonFTE)
    $form1.Controls.Add($radiobuttonContractor)
    $form1.Controls.Add($buttonOK)
    $form1.AcceptButton = $buttonOK
    $form1.ClientSize = '508, 262'
    $form1.FormBorderStyle = 'FixedDialog'
    $form1.MaximizeBox = $False
    $form1.MinimizeBox = $False
    $form1.Name = "form1"
    $form1.StartPosition = 'CenterScreen'
    $form1.Text = "Form"
    $form1.add_Load($FormEvent_Load)
    # datetimepicker1
    $datetimepicker1.Location = '160, 91'
    $datetimepicker1.Name = "datetimepicker1"
    $datetimepicker1.Size = '200, 20'
    $datetimepicker1.TabIndex = 3
    $datetimepicker1.Visible = $False
    # radiobuttonFTE
    $radiobuttonFTE.Location = '33, 57'
    $radiobuttonFTE.Name = "radiobuttonFTE"
    $radiobuttonFTE.Size = '104, 24'
    $radiobuttonFTE.TabIndex = 2
    $radiobuttonFTE.TabStop = $True
    $radiobuttonFTE.Text = "FTE"
    $radiobuttonFTE.UseVisualStyleBackColor = $True
    # radiobuttonContractor
    $radiobuttonContractor.Location = '33, 87'
    $radiobuttonContractor.Name = "radiobuttonContractor"
    $radiobuttonContractor.Size = '104, 24'
    $radiobuttonContractor.TabIndex = 1
    $radiobuttonContractor.TabStop = $True
    $radiobuttonContractor.Text = "Contractor"
    $radiobuttonContractor.UseVisualStyleBackColor = $True
    $radiobuttonContractor.add_CheckedChanged($radiobuttonContractor_CheckedChanged)
    # buttonOK
    $buttonOK.Anchor = 'Bottom, Right'
    $buttonOK.DialogResult = 'OK'
    $buttonOK.Location = '421, 227'
    $buttonOK.Name = "buttonOK"
    $buttonOK.Size = '75, 23'
    $buttonOK.TabIndex = 0
    $buttonOK.Text = "OK"
    $buttonOK.UseVisualStyleBackColor = $True
    #endregion Generated Form Code
    #Save the initial state of the form
    $InitialFormWindowState = $form1.WindowState
    #Init the OnLoad event to correct the initial state of the form
    $form1.add_Load($Form_StateCorrection_Load)
    #Clean up the control events
    $form1.add_FormClosed($Form_Cleanup_FormClosed)
    #Show the Form
    $form1.ShowDialog()
    ¯\_(ツ)_/¯

  • List View Report with pipelined function in Mobile application and ORA-01007: variable not in select list

    Hi!
    I have a problem with List View Report in mobile application (theme 50 in apex) after updating to apex 4.2.2. I created Report -> List View. I used select from pipelined function in Region Source. Then when page is running and submited three times (or refreshed three times) I get an error:
    Error during rendering of region "LIST VIEW".
    ORA-01007: variable not in select list
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -1007
    ora_sqlerrm: ORA-01007: variable not in select list
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 21230833903737364557
    component.name: LIST VIEW
    error_backtrace:
         ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613
         ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
    I get this error only when I use select from pipelined function in Region Source (for example: "select value1, value2 from table(some_pipelined_function(param1, param2)) ").
    You can check it on http://apex.oracle.com/pls/apex/f?p=50591 (login - demo, password - demo).
    In this application:
    - I created package TAB_TYPES_PKG:
    create or replace PACKAGE TAB_TYPES_PKG IS
    TYPE cur_rest_r IS RECORD (
        STR_NAME          VARCHAR2(128),
        INFO              VARCHAR2(128)
    TYPE cur_rest_t IS TABLE OF cur_rest_r;
    END TAB_TYPES_PKG;
    - I created pipelined function TEST_FUNC:
    create or replace
    FUNCTION TEST_FUNC
    RETURN TAB_TYPES_PKG.cur_rest_t  PIPELINED IS
    r_cur_rest TAB_TYPES_PKG.cur_rest_r;
    BEGIN
    r_cur_rest.STR_NAME := 'ROW 1';
    r_cur_rest.INFO := '10';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 2';
    r_cur_rest.INFO := '20';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 3';
    r_cur_rest.INFO := '30';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 4';
    r_cur_rest.INFO := '40';
    PIPE ROW (r_cur_rest);
    r_cur_rest.STR_NAME := 'ROW 5';
    r_cur_rest.INFO := '50';
    PIPE ROW (r_cur_rest);
    RETURN;
    END TEST_FUNC;
    - I created List View Report on Page 1:
    Region Source:
    SELECT str_name,
           info
    FROM TABLE (TEST_FUNC)
    We can see error ORA-01007 after refresing (or submiting) Page 1 three times or more.
    How to fix it?

    Hi all
    I'm experiencing the same issue.  Predictably on every third refresh I receive:
    Error
    Error during rendering of region "Results".
    ORA-01007: variable not in select list
    Technical Info (only visible for developers)
    is_internal_error: true
    apex_error_code: APEX.REGION.UNHANDLED_ERROR
    ora_sqlcode: -1007
    ora_sqlerrm: ORA-01007: variable not in select list
    component.type: APEX_APPLICATION_PAGE_REGIONS
    component.id: 6910805644140264
    component.name: Results
    error_backtrace: ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 4613 ORA-06512: at "APEX_040200.WWV_FLOW_DISP_PAGE_PLUGS", line 3220
    OK
    I am running Application Express 4.2.2.00.11 on GlassFish 4 using Apex Listener 2.0.3.221.10.13.
    Please note: this works perfectly using a classic report in my desktop application; however, no joy on the mobile side with a list view.  I will use a classic report in the interim.
    My region source is as follows:
    SELECT description AS "DESCRIPTION", reference AS "REFERENCE" FROM TABLE(AUTOCOMPLETE_LIST_VIEW_FNC('RESULTS'))
    The procedure:
      FUNCTION AUTOCOMPLETE_LIST_VIEW_FNC(
          p_collection_name IN VARCHAR2)
        RETURN list_row_table_type
      AS
        v_tab list_row_table_type := list_row_table_type();
      BEGIN
        DECLARE
          jsonarray json_list;
          jsonobj json;
          json_clob CLOB;
        BEGIN
          SELECT clob001
          INTO json_clob
          FROM apex_collections
          WHERE collection_name = p_collection_name;
          jsonobj              := json(json_clob);
          jsonarray            := json_ext.get_json_list(jsonobj, 'predictions');
          FOR i IN 1..jsonArray.count
          LOOP
            jsonobj := json(jsonArray.get(i));
            v_tab.extend;
            v_tab(v_tab.LAST) := list_row_type(json_ext.get_string(jsonobj, 'description'), json_ext.get_string(jsonobj, 'reference'));
          END LOOP;
          RETURN(v_tab);
        END;  
      END AUTOCOMPLETE_LIST_VIEW_FNC;
    Thanks!
    Tim

Maybe you are looking for

  • Error while reading wsdl file exception null

    Hi I am trying to invoke a proxy service (web service) wsdl from a bpel process. When i add a web service adapter, put url of external web service and save it, all my service end points defined in the BPEL process are becoming non editable. Binding o

  • Terms of payment key in INVOIC01 Idoc

    Hi, We are processing inbound INVOIC01 IDOC types to load suppliers invoices in SAP. In the segment E1EDK01, the field ZTERM ( Terms of payment key ) is filled with a valid value. The problem is the invoice is created with blanks in that field, so th

  • Links work in Dreamweaver but not online

    Hello, I am trying to figure out why my flash files work correctly locally but don't after I upload them. I am using Mac Flash CS4 and AS2. (They were CS3 files originally) When I use Safari to view the uploaded files and check the Activity window it

  • Pls Help: View Crystal Report Via Oracle Form Builder

    Hi!! I want to know how to view the .rpt report (report made from Crystal Report) via Oracle Form Builder. I've to do it in my project. If you know, please tell me. Thanks in advance,

  • How do you crop photos?

    I have iPhoto version 2. I have printed the instructions in iPhoto Help for cropping photos, but I seem to need more help. Following the 4 steps in the iPhoto Help section, I seem to have isolated the part of the photo that I want to print and e-mail