Variable not expanding in command, unsure why

Hello, I have a relatively straightforward problem in a script I am making, it has to do with a variable not expanding properly but I am unsure why and not sure what else I can do to further debug the issue, any advise would be appreciated.
Basically I have a variable containing a pc name:
$pcName="myPC"
and I want to use that in a script to get the pc:
Get-ADComputer -Filter {Name -like "$pcName"} -Properties LastLogonDate 
However, that command returns nothing but if I manually put in the name:
Get-ADComputer -Filter {Name -like "myPc"} -Properties LastLogonDate 
it does work properly.
What am I doing wrong?
I have tried:
Get-ADComputer -Filter {Name -like "$($pcName)"} -Properties LastLogonDate
which also does not work, to me it looks like it is a problem with the shell not expanding the variable inside that filter block, but I'm not sure why this would happen.
Edit:
I have found out that doing:
Get-ADComputer -Filter {Name -like $pcName} -Properties LastLogonDate
does work, but really it does not help me completely, as I would actually like to search for "$pcname*" which continues to fail, I realize that i can just append the * to the variable before this line, but I still would like to figure out whats
going on here with why it will not expand the string as i expected it to in the filter block.

This does work, it makes sense to me because it's using the string version of the -Filter parameter and backticking the quotes on the inner part for the name.  Would be nice if this did work within the filterblock still but at least that gets me going
for now.

Similar Messages

  • Why do the youtube clips not expand properly when I double click on the page

    why do the youtube clips not expand properly when I double click on the page

    The exclamation mark is telling you that iPhoto has broken the file path/link to the original file. Assuming you're using iPhoto 9 or later Apply the two fixes below in order as needed:
    Fix #1
    1 - launch iPhoto with the Command+Option keys held down and rebuild the library.
    2 - run Option #4 to rebuild the database.
    Fix #2
    Using iPhoto Library Manager  to Rebuild Your iPhoto Library
    1 - download iPhoto Library Manager and launch.
    2 - click on the Add Library button and select the library you want to add in the selection window..
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the Library ➙ Rebuild Library menu option.
    4 - In the next  window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be left untouched for further attempts at fixing the problem or in case the rebuilt library is not satisfactory.
    OT

  • Why not create a command

    why not create a command that shows you how many miles the paket travel to distination . that way you can figure out your lentency right there base on the distance..
    show distance x.x.x.x
    it will show you the distance from b/w the interface you are seating on to the interface you are requesting
    hehe lol :-) haha bzzzzzzzz!!!!!

    Hi,
    Select>Color Range is only in photoshop (i.e photoshop cs6 or cc 2014 as examples) and not in photoshop elements.
    You could double click on the layer thumbnail in the layers panel to unlock the layer.
    Select the background with the Magic Wand Tool.
    Then Edit>Cut and that should make everything but the actual logo transparent.
    Then save as a png, tif or psd file.
    There is also a photoshop elements forum
    (you posted in the photoshop forum)
    https://forums.adobe.com/community/photoshop_elements

  • HT4009 I have purchased the "Sky Sports TV" app but since my satellite subscription have benn cancelled I cant view the channels anymore. I am unsure why I am paying a monthly fee of £4.99 if this does not entitle me to watch Sky Sports, as there is no ot

    I have purchased the "Sky Sports TV" app but since my satellite subscription have been cancelled I cant view the channels anymore. I am unsure why I am paying a monthly fee of £4.99 if this does not entitle me to watch Sky Sports, as there is no other functionality in the app other than watching tv channels ( which I cant do currently)
    I will be looking for a full refund for all current and past monthly subscriptions.

    There are instructions on this page for managing and stopping auto-renewing subscriptions : http://support.apple.com/kb/HT4098
    In terms of a refund, all purchases are considered final, but you can try contacting iTunes support and see if they will refund or credit you (these are user-to-user forums) : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Why : Data Control entry not expandable/empty - ADF Task flow based on HT.

    Hi All,
    I've hoping to create an ADF Task flow based on a human task. I have a stand alone ADF application within the ViewController of which I am attempting to create this task flow. The resultant data control entry doesn't seem to be expandable.
    Questions
    1. When creating an ADF Taskflow based on a human task, should it always be within a project in the same application as the SOA components?
    2. If no, is the resultant human task data control empty or not expandable because the xsd for the HT is based on the MDS? I have configured all the MDS connections within my application.
    JDev : 11.1.1.4
    Thanks
    PP

    Hi,
    Answers :-
    1. No, it is not necessary that your ADF Taskflow based on Human Task should be in the same application where the SOA Project Resides. But for the deployment of that ADF Taskflow you will need the SOA Project.You can add that project whenever you want to deploy.
    2. It might be the cause due to the MDS Configuration .
    Do one thing , while creating the ADF Taskflow based on Human Task , you do select the .task file via the file system not from the MDS.
    If you will select the .Task file of your soa project then it will ask you to name the Taskflow, just name the taskflow as you want and say ok.
    After creating the taskflow, it will add a lot of xml files in your project and it will create a data control of it.
    Hope it helps!!
    Regards,
    Shah

  • Variable not found in build

    When I run my program in the development stage, it runs with no problem.  When I build the exe and try to run it, I get a variable not found error.  I don't understand how it can run in the development stage with no problem but not as an exe file.
     Any suggestions as to why this is happening.
    Thanks

    The simplest solution is to look at the line of code which causes this error...
    If you don't have error handling in your code then simply place following command at the code beginning:
    ON ERROR WAIT WINDOW "Error: " + TRANSFORM(ERROR()) + " Line: " + TRANSFORM(LINENO()) + " in: " + SYS(16)
    and then you may look what line causes the problem and investigate why the variable is not present.
    Of course, you have to build the EXE with debug info (set it in Project options).

  • Hundreds of my iPhoto pictures will not be copied and will not show when I double-click on them.  When I do in iPhoto an exclamation surrounded by a triangle appears.  Though I can see the picture in the small tiles below it will not expand.

    Hundreds of my iPhoto pictures will not be copied and will not show when I double-click on them.  When I do in iPhoto an exclamation surrounded by a triangle appears.  Though I can see the picture in the small tiles below it will not expand.  I also cannot attach any of these pics into an e-mail or into any other file.  I have already went through all 3 Repair options and when that did not solve it went through a complete Rebuild.  Any Help?!  Any Suggestions on how to fix this?!  I have spent almost 2 days now going through all of the published help.
    I have backups going back 6 months - I have not had the real need to check every album before - but - all of my backups also have this same problem.

    The triangle with the ! indicates that the connection between the thumbnail and the orginal is missing - this can be caused by many things including database corruption and user action emoving the originals photos on urpose or by accident
    If the database is corrupted then rebuilding is the solution - backup and depress the option and command keys, launch iPhoto and rebuild your database  --  if the iPhoto rebuild does not cure the problem then download iPhoto Library manager and use its rebuild command which creates a totally new library leaving the existing one untouched
    If you have deleted the photos then you need to start over with a new library and import the photos you have not deleted into it
    You can select one of the problem photos and use the reveal original in finder commander (file menu) to see if the original is there - if it is a finder window will open showing it
    LN

  • Variable not found in class - Newbie

    public void executeSearch() {
    try {
    File startSearchDir = new File(directory);
    } catch (NullPointerException npe) {
    System.out.println("The file path entered is not valid.");
    return;
    File [] fileArray = startSearchDir.listFiles();
    Why is the startSearchDir variable not found on the last line of this method?
    Thanks,
    Devon

    This is the whole class. I have tried the previous suggestion but then I get a duplicate declaration for the variable.
    package PgScan;
    import java.awt.*;
    import javax.swing.JPanel;
    import java.io.*;
    import java.lang.reflect.Array;
    * Title: Page Scanner
    * Description: Page scanner recurisively scans through subdirectories through a provided path and
    * for a provided tag.
    * Copyright: Copyright (c) 2001
    * @author
    * @version 1.0
    public class PgScan extends JPanel {
    BorderLayout borderLayout1 = new BorderLayout();
    private String directory = "";
    private String searchString = "";
    public PgScan() {
    try {
    jbInit();
    catch(Exception ex) {
    ex.printStackTrace();
    private void jbInit() throws Exception {
    this.setLayout(borderLayout1);
    //Main Method
    public static void main(String[] args) {
    PgScan pgScan1 = new PgScan();
    //Properties
    public String getDirectory() {
    return directory;
    public void setDirectory(String newDirectory) {
    directory = newDirectory;
    public String getSearchString() {
    return searchString;
    public void setSearchString(String newString) {
    searchString = newString;
    //Methods
    public void executeSearch() {
    try {
    File startSearchDir = new File(directory);
    } catch (NullPointerException npe) {
    System.out.println("The file path entered is not valid.");
    return;
    File [] fileArray = startSearchDir.listFiles();
    TIA,
    Devon

  • Could not complete the command because of a problem using the Adobe Color Engine

    Hi all
    This bizarrely started this morning - completely out of the blue - and I've no idea why.
    Setup: Mac 10.8.2 / Creative Suite Premium PhotoShop CS5 extended (patched to 12.04)
    Am working on images exported from LightRoom 4 (16bit A3 Pro Photo RGB PSDs) in PhotoShop CS5.
    As part of my image grading process I have a PhotoShop Action that does the following: copy layer to new document (document respects all of copied layer settings) > Image > Adjustments > HDR toning > apply a certain HDR preset > copy to resultant image back to original doc > set opacity as 40%.
    Totally out of the blue, after having this action for about 2 months, this morning I start getting a warning dialog of "Could not complete the command because of a problem using the Adobe Color Engine" and the action fails. The failure seems to take place at the 'make document' part of the action and seems to somehow be related to the contents of the clipboard.
    I've tried trashing and re-creating the action. It works first time out fine and then - on the next image - errors again.
    At present I can only safely carry out the work 'manually' by completing all the actions myself.
    I can think of no settings that have changed and the OS hasn't been updated in a while.
    I have found one other thread on a similar problem in PhotoShop Elements, but no definitive solution.
    Any help appreciated as I have a shedload of stuff to process.
    Best wishes
    TP

    OK: trash of prefs didn't work. Tried thrice. Re-created orig action. same problem.
    BUT!
    Your 'Image > Duplicate' suggestion does seem to work. If I use that in a new action as the method for creating the HDR version doc (instead of 'Select > Copy > New > Paste), it seems to work.
    Will try that out this afternoon, but for now: WIN!
    Many thanks for the suggestion!
    TP

  • Error: Object variable or with variable not set while accessing BPC Excel

    Hi,
    I am working on BPC NW 7.5. When I am trying to access BPC for Excel I am getting the below error.
    'object variable or with variable not set'
    When I click on BPC for Excel it ask for the credentials, after entering it we encounter this error.
    Any idea why is this happening?
    Regards,
    Priyanka Singh

    Hi Renne,
    Could you share me the solution to resolve the issue?
    I am getting an error "object variable or with block variable not set" while trying to submit data through an Input schedule.
    I am working on SAP BPC 7.0 NW and using MS Excel 2003.
    I can log in to BPC Admin and excel with my user id and password.
    Only when i am trying to click esubmit --> send and refresh schedules i am getting this error.
    I checked my security profile and i have the submit data task in my task profile.
    Following couple existing SDN postings i tried to check the ADD-INs of the excel on my system. However it looks like the steps listed in the existing SDN posts are for MS EXCEL 2007.
    Please suggest me how do i resolve this issue. Please note I am working on SAP BPC 7.0 NW and using MS Excel 2003.
    Regards,
    Jagat

  • "Object Variable or With Block Variable not set" Error on Adobe Presenter 8 Ribbon on PPT 2010/2007

    Returning back from Adobe training at KEDRIYA VIDYALAYA no 1  Jalhalli Bangalore when I started Powerpoint to use Adobe Presenter 8  I am getting : "Object Variable or With Block Variable not set " error on clicking any of the menu features of the Presenter Ribbon. My Config are :
    i)             WINDOWS XP SP 3
    ii)            POWERPOINT 2007 / 2010 ( for both same error is coming)
    iii)           MS XML Library 4.0 installed.
    iv)           Adobe Presenter 8
    I am using all liscenced copies of softwares.
    Hardware specs are also as per Minimum Adobe standards.
    I Have tried a lot removing Data Execution Prevention Mode , but all in vain the problem still exists
    Why is this happening. Please help.
    Kamal K Gupta
    PGT Comp. SC.
    KV No. 2 Srivijaya nagar

    This is not really a "Downloading, Installing, Setting Up" question; you may get better help if you ask in the Presenter forum.

  • ORA-01007 - variable not in select list error in pl\sql code

    Hi,
    When I tried to run this program I am getting below error:
    ORA-01007 - variable not in select list.Please help to resolve.
    Code:
    create or replace procedure "XX_BPM_DATA_P" (P_PROCESS_ID IN VARCHAR2)
    is
    TYPE l_entity_type IS TABLE OF xx_BPM_data.ENTITY%TYPE INDEX BY PLS_INTEGER;
    TYPE l_data_type IS TABLE OF XX_BPM_DATA.DATA%TYPE INDEX BY PLS_INTEGER;
    TYPE l_count_type IS TABLE OF XX_BPM_DATA.count%TYPE INDEX BY PLS_INTEGER;
    l_Entity_v l_Entity_type;
    l_data_v l_data_type;
    l_count_v l_count_type;
    l_security_group_id number;
    app_id number(20);
    l_Actual_value XX_BPM_DATA.DATA%TYPE;
    cursor BPM_CUR is select id,process_id , sequence, to_char(query) query,report_num from xx_test_bpm_dynamic
    where
        process_id = p_process_id
           and report_num=1
    order by process_id, sequence;
    BEGIN
    --delete xx_bpm_data where process_id = p_process_id;
    for bpm_rec in bpm_cur
    loop
    delete xx_bpm_data
    where process_id = bpm_rec.process_id
    and sequence = bpm_rec.sequence
    and report_num = bpm_rec.report_num;
    l_security_group_id := apex_custom_auth.get_session_id_from_cookie;
    --dbms_output.put_line(l_security_group_id);
    execute immediate bpm_rec.query BULK COLLECT INTO l_ENTITY_v,l_DATA_v,l_count_v;
    if (bpm_rec.report_num=2) then
    app_id:= 108;--NV('APP_ID');
    FORALL i IN l_ENTITY_v.FIRST..L_ENTITY_V.LAST
    INSERT INTO XX_BPM_DATA
        (EnTITY,
    value,data,count,
    Process_ID,
    Sequence,report_num)
    VALUES(l_entity_v(i),
    l_data_v(i),
    '<A HREF="f?p='||app_id||':301:'||':APP_SESSION'||'::::P301_process_id,p301_sequence,p301_id,p301_entity:'||bpm_rec.process_id||','||bpm_rec.sequence||','||bpm_rec.id||','||l_entity_v(i)||':">'||l_data_v(i)||'</A>',
        l_count_v(i),bpm_rec.process_id,
    BPM_rec.sequence,
    bpm_rec.report_num);
    else
    FORALL i IN l_ENTITY_v.FIRST..L_ENTITY_V.LAST
    INSERT INTO XX_BPM_DATA(EnTITY,data,
        count,
    Process_ID,
    Sequence,report_num)
    VALUES(l_entity_v(i),
    l_data_v(i),
        l_count_v(i),
        bpm_rec.process_id,
    BPM_rec.sequence,
    bpm_rec.report_num);
    end if;
    select round(avg(value),2) into l_actual_value from xx_bpm_data where process_id=bpm_rec.process_id and sequence=bpm_rec.sequence and report_num=bpm_rec.report_num;
    update xx_test_bpm_dynamic set value=l_actual_value where process_id=bpm_rec.process_id and sequence=Bpm_rec.sequence and report_num= bpm_rec.report_num;
    end loop;
    Commit;
    END;

    When I tried to run this program I am getting below error:
    ORA-01007 - variable not in select list.Please help to resolve.
    You likely would not need any help in you wrote and tested your code using standard best practices.
    Your code has NO exception handler and you are NOT identifying each step in the code so that the exception handler could print/log a message telling you EXACTLY which step raised the exception.,
    v_step NUMBER;
    -- before step 1
    v_step := 1;
    -- before step 2
    v_step := 2;
    Then in the exception handler the value of 'v_step' will tell you which step raised the exception.
    The exception you posted refers to a 'select list' so examine ALL of the select lists in your code. If you do that you will see that the primary query being run is obtained from a database table and then executed using dynamic SQL
    execute immediate bpm_rec.query BULK COLLECT INTO l_ENTITY_v,l_DATA_v,l_count_v;
    We have no way of knowing what query is in 'bpm_rec.query' when the exception happens or what columns that query returns. For all we know the query returns 2 columns and you are trying to load 3 collections. Or maybe the query returns 8 columns and you are trying to load 3 collections.
    Why don't you print out the query and execute it manually so you can see exactly what the result set looks like?
    dbms_output.put_line(bpm_rec.query);
    And don't even get us started on why you are using such security-prone dynamic sql to perform this processing instead of using ordinary SQL statements. Or why you are using associative arrays for the BULK COLLECT instead of nested tables.
    In short your code could blow up in several places and, because you have NO logging statements, control statements or exception handlers, anyone having to troubleshoot that code would have absolutely no idea what part of it may be the problem.

  • Evaluate variable Not working properly

    Hi
    When i used Evaluate variable , It is having list of Operator (=,<>,IN etc).
    When is specified operator '=' and give one value its working properly.
    eg. Select name from table ;
    O/p = AA
    In ODI , Operator =AA its working .
    But when i specified Operator "IN" and giving value ('AA','AB') Or value (AA,AB) its not working propelry.
    Any other operator or any other option to use IN operator.
    Thanks
    Ashwini

    Hi,
    I never saw that "IN" woks!
    There is a workaround, use a at variable refresh tab a command like: (you can refresh the variable from itself)
    select case when '#project_code.my_var' in ('ab','a','x')
    then 'OK'
    else 'KO'
    end
    from dual
    put it as refresh step and add a new instance as evaluate "= OK"
    Does it help you?
    Edited by: Cezar Santos on 05/02/2009 08:59

  • "Object variable or With block variable not set" error

    I have Presenter 6.2 installed into PowerPoint 2007 on a XP
    operating system. I have successfully used this product a couple of
    months ago.
    Evidently now I am getting an Adobe Presenter error prompt
    that says "Object variable or With block variable not set" for
    every feature I click on in PP.
    I have reinstalled Presenter to see if that would fix it. It
    did not. I uninstalled/deleted it from my PC and then installed a
    fresh copy. I still get the same issue prompt.
    Has anyone experienced this and if so got any suggestions on
    how to fix it?

    I am having the same problem, and I have since I installed this  add-in a month ago, honestly I am wondering why people use this  product.  Others around me are not having this issue so I don't know  what is going on.
    I have called Adobe 3 times,
    I  tried uninstalling and re-installing Presenter - no luck
    I tried  disabling and enabling the add-in - no luck
    I updated to version  7.0.5, http://www.adobe.com/support/downloads/product.jsp?product=153&platform=Windows   (make sure you install 7.0.1, then 7.0.2, then 7.0.5 in this order)  still  had problems - but I did just find this post from 2009, and I am going  to try starting a new presentation (updates would not help a current  PP), which really is not great because I have a 60 slide class at this  time.
    http://forums.adobe.com/message/2332717#2332717
    Give  it a try and let me know if it works or if you find a solution!

  • Variable not found in repository - Done

    Hi,
    I have an ODI procedure for Oracle SP which needs an input param . Syntax
    begin
    Proc(sessionId);
    end;
    Generated a scenario out of this procedure. I want to use this scenario in some package.
    Steps:
    1)Created a variable; dragged that as a first step in the package
    2)Interface
    3)ODI Procedure Scenario ( used the additional variable field) : Command generated for Scenario --
    OdiStartScen "-SCEN_NAME=BATCHREPORT" "-SCEN_VERSION=003" "-INVOICEPROCCESSING.sessionId=#sessionId"
    I tried using the additional variable filed in the scenario , when dragged into a package; while executing the package an error occurs.
    java.lang.Exception: Specified variable not found in the Repository : INVOICEPROCCESSING.sessionId
    Thanks,
    Is
    Done!
    Edited by: Is916 on Sep 2, 2009 1:57 AM

    Hi,
    Are you creating temp tables in our code, if yes
    if we have a same temp table name as that of the variable it will not work for that connection.
    try it with a different variable name.
    Regards,
    Naveen

Maybe you are looking for

  • How can I use unix commands from oracle report

    I have to use the following command from oracle reports. In oracle forms we can use the HOST command but what about oracle reports2.5. I have to email the attached file 100245.pdf from oracle reports to the given email id uuencode 100245.pdf 100245.p

  • Control of Inspection Lot Creation in Material Master settings

    Hi There are settings like 1 for each  document material,  batch ,storage location 2 for each   material,  batch ,storage location . X for PO  , batch and storage location . for each material document item In the Control inspection settings of materi

  • PO creation from EXCEL uploaded by a Gateway Service in UI5

    Hi, The business requirement is to create Purchase Order from Excel File, uploaded from the UI5 application and call Gateway Service to create PO in SAP ECC. I am trying to achieve this with CREATE_STREAM method of DPC. However, my concern here is th

  • Request message mapping failed in QAS server

    Hi , I've transported the Developed  objects from DEV Server to QAS Server using CTS method , now when i m making any changes in the development system and re transporting it back to quality server , its showing one or the other error , In one case i

  • Itunes problems with Vista

    Has anyone run into a problem with Itunes not being able to play audio tracks from cd, and not able to import from a cd? (Using Vista Ultimate)I can play existing audio files, but not from a disc and it won't import. I have tried uninstalling vers. 7