Turn simple powershell into a script

I have quite a few libraries that share the same column names and all need to be given default values.
Rather than doing this by hand in the GUI I am turning to PS.
I have few lines of PS (see below) and this works fine but I don't want to have to keep typing pasting so have decided I need to turn it into a script and pass three arguments to it so I can keep calling the script with different values.
Can someone advise the correct syntax to transform these lines into UpdateColumns.ps1 and then how I would call it and pass threee arguments please.
I have replaced the hard coded values with $VAR1, $VAR2 and $VAR3 to show what I need to use as arguments.
$site = Get-SPWeb http://server/site/sub
$list = $web.Lists[$VAR1]
$Field = $List.Fields[$VAR2]
$Field.DefaultValue = $VAR3
$Field.Update()
$List.Update()
$web.Dispose()

That error would be from one of these two lines:
$list = $web.Lists[$var1]
$Field = $List.Fields[$var2]
So either you don't have a list named "comms" or a column named "function". The display name of the column and the "internal name" of the column may be different. To find the internal name go to the list's settings page, scroll down to the columns section
and click the "function" column. Inspect the URL of that page looking for &Field= and use the name listed there.
Mike Smith TechTrainingNotes.blogspot.com
Books:
SharePoint 2007 2010 Customization for the Site Owner,
SharePoint 2010 Security for the Site Owner

Similar Messages

  • I get this message when trying to past simple text into an e-mail document. The Web-Based Email plugin has crashed. I have run out of options...please help.

    The Web-Based Email plugin has crashed. I get this message when trying to paste simple text into an email document. I have updated plugins and have run out of options. If I use another browser I have no problem. Please advise.

    UPDATE
    Compiling from command line I found out that the class definition for oracle.oats.scripting.modules.basic.api.IteratingVUserScript is missing. Do you know what .jar file contains this class?
    Thanks.
    Fede.

  • How to apply a simple javascript into JSF

    Hi everyone. This is my first time using JSF and i am abit confuse in applying some simple javascript into my JSF. Actually, i just want to add a simple function that is to disable user from input some certain textfield (h:inputText) based on the selection in the combo box (h:selectOneMenu).
    The javascipt that i would like to apply in the JSF coding is shown as below:-
    <HTML>
    <TITLE>Example of onChange Event Handler</TITLE>
    <HEAD>
    <SCRIPT LANGUAGE="JavaScript">
    function textField()
    if(document.myform.mcDonald.value=="disable")
    document.myform.data.disabled=true;
    if(document.myform.mcDonald.value=="enable")
    document.myform.data.disabled=false;
    </SCRIPT>
    </HEAD>
    <BODY>
    <H3>Example of onChange Event Handler</H3>
    <form name="myform">
    <SELECT NAME="mcDonald" onChange="textField()">
    <OPTION VALUE="enable">Enable
    <OPTION VALUE="disable">Disable
    </SELECT>
    <input type="text" name="data" value="10" size=10 disabled="true" >
    </form>
    </BODY>
    </HTML>

    You need to use the id's of the components in the hierarchy. This is actual working code:
    // Javascript
              function actionedStatus_onchange(formObj, fieldValue) {
                   formObj.elements['foureye:tabExceptions:unresolvedOnly'].disabled = (fieldValue != 'all');
                   formObj.elements['foureye:tabExceptions:unresolvedOnly'].checked = (fieldValue == 'all');
    // JSF
                   <x:selectOneMenu id="actionedStatus" styleClass="detailBondField" value="#{exceptionsBean.actionedStatus}"
                             onchange="actionedStatus_onchange(this.form, this.value)">
                        <f:selectItems value="#{lookupBean.actionedStatusList}"/>
                   </x:selectOneMenu>
    In this case, the root component form is 'foureye' (a subview), followed by 'tabExceptions' (a form), followed by a checkbox 'unresolvedOnly' that I want to manipulate. Here I am disabling the checkbox and setting the value dependent on the value of the selectOneMenu

  • Where can I get a Lightroom preset that turns a portrait into a sketch?

    Where can I find a Lightroom that turns a portrait into a sketch?

    If Photoshop or Photoshop Elements is installed, LR can pass an image to that directly; but any other application or standalone utility that you use to carry out a job like this, can be set up as a named "external editor" preset. This gives equally easy access from inside LR. You don't need to Export a copy, start a program, find and open the image; nor, then import the results back to LR - these steps are all automated for you.
    You right-click on an image and select your editing preset in the context menu; LR saves a copy of your current image and opens it into the other program. You complete the task there, Save and close. LR now (all by itself) shows two versions of that image - the one you saw before, and a new one which shows the results of your external edit.
    So even though LR is not in fact doing the task, but subcontracting it out - it is still just about as convenient for the user, as it would be if this were a true LR extension / plugin.
    Some Photoshop plugins come in a standalone version as well, and in that case, the standalone app can be used as a targeted editor by LR, which may be faster and simpler. However if you do use such a plugin (or technique using standard tools) within PS, or other full-featured image editor, you have a full range of other editing possibilities there at the same time; for example, so you can mask and vary the strength of your "sketch" effect across different parts of the photo.

  • What is the best way to turn line art into a 3D image in Illustrator? Thanks for your help.

    What is the best way to turn line art into a 3D image in Illustrator? Thanks for your help.

    What version of Illustrator? What do you mean by "Line Art"? What do you mean by "3d image"? Post images showing your starting artwork and an example of what you are trying to achieve.
    If you have Illustrator 12 or higher you can extrude or lathe a simple group or path using Effects > 3D > [Pick one]. You must start with vector data, not a placed raster image. You are very limited in what you can do, and you cannot model multiple objects within one 3D world. Each object you extrude/revolve/rotate is its own world, with its own perspective and camera. You can also make any art into a Symbol, then map that symbol onto any 3D surface you create. The results are, at best, acceptable, and often total garbage.

  • BI 7 : Command to export a table structure of SAP R/3 into a script/text ?

    Hi All.
    Greetings.
    Am New to SAP R/3 system.  And request help.
    We are trying to pull data from SAP R/3 thro Bussiness Objects Data Services into Oracle.
    For now : we create a target oracle table looking at the table structure of SAP R/3 from SE 11.
    In BODS, We then do the query transformation, and use the oracle target table created by us manually.
    This works absolutely fine.
    We would like to know the command by which we could export the table structure of any existing table
    in SAP R/3 into a script / or to text file,
    which we could use to create the same table structure in oracle.
    Rather than manually typing some 200 field names for each tables.
    Can anyone advise on this.
    Thanks
    Indu

    Hello,
    The problem is caused due to the spaces in your directories
    C:\SAP Dumps\Core Release SR1 Export_CD1_51019634/DB/ADA/DBSIZE.XML
    Replace the spaces with underscores and restart the installation from from scratch.
    Cheers
    Bert

  • How to SIMPLY use the %DIMENSION_TO_SET% variables into logic scripts

    hello,
    I'm using a prompt of type "COPYMOVE" or "COPYMOVEINPUT". In this type of prompt, there are 2 columns of dimension members list, one for defining the "source zone" and one for defining the "target zone" of logics.
    The left colum of the prompt (for source zone) feeds the variables %DIMENSION_SET% : %ACCOUNT_SET%, %ENTITY_SET%, %CATEGORY_SET%, etc...and these variables can be used in the logic scripts in *XDIM_MEMBERSET instructions for example.
    The right colum of the prompt feeds the variables %DIMENSION_TO_SET% : %ACCOUNT_TO_SET%, %ENTITY_TO_SET%, %CATEGORY_TO_SET%, etc...and I don't know how to SIMPLY use these variables in the logic scripts.
    I've found a tricky way to do that but I meet 2 problems :
    - it is complicated
    - the multi-info instruction (BEGININFO/ENDINFO) seems to be bugged as blank lines are added all the time in the code and sometimes I have to wait for minutes when I try to modifiy the package code through BPC for excel eData/modify package menu.
    So the question is how to SIMPLY get the %DIMENSION_TO_SET% variables into logic scripts and use them ? Thanks, R.
    Here is the tricky package code I use at this time (I build one function for each %DIMENSION_TO_SET% variable and I pass these functions to the logic) :
    PROMPT(COPYMOVE,,,,"ACCDETAIL,ACCOUNT,CATEGORY,DATASRC,ENTITY,TIME,YEARS")
    TASK(Execute formulas,USER,WS-WW\PlauchuR)
    TASK(Execute formulas,APPSET,US)
    TASK(Execute formulas,APP,SV)
    TASK(Execute formulas,SELECTION,D:\BPC\Data\WebFolders\US\SV\PrivatePublications\PlauchuR\TempFiles\FROM_1561_.TMP)
    TASK(Execute formulas,TOSELECTION,D:\BPC\Data\WebFolders\US\SV\PrivatePublications\PlauchuR\TempFiles\TO_1561_.TMP)
    BEGININFO(%FSS%)
    *FUNCTION TARGETACCDETAIL=%ACCDETAIL_TO_SET%
    *FUNCTION TARGETACCOUNT=%ACCOUNT_TO_SET%
    *FUNCTION TARGETCATEGORY=%CATEGORY_TO_SET%
    *FUNCTION TARGETDATASRC=%DATASRC_TO_SET%
    *FUNCTION TARGETENTITY=%ENTITY_TO_SET%
    *FUNCTION TARGETTIME=%TIME_TO_SET%
    *FUNCTION TARGETYEARS=%YEARS_TO_SET%
    ENDINFO
    TASK(Execute formulas,FORMULASCRIPT,%FSS%)
    TASK(Execute formulas,LOGICFILE,D:\BPC\Data\WebFolders\US\SV
    ..\AdminApp\SV\_TEST.Lgf)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    Edited by: ALEXANDRE BEDIER on Jun 16, 2010 3:15 PM

    hello,
    finally I've discovered that there is no need of BEGININFO instruction.
    One can pass several functions to a logic with one FORMULASCRIPT task. The functions definitions have to be separated by instructions. See below :
    PROMPT(COPYMOVEINPUT,%FTARGETS%,,"select source and target zone for category and datasource.","ACCDETAIL,ACCOUNT,CATEGORY,DATASRC,ENTITY,TIME,YEARS")
    TASK(Execute formulas,FORMULASCRIPT,*FUNCTION TACCDETAIL=%ACCDETAIL_TO_SET% *FUNCTION TACCOUNT=%ACCOUNT_TO_SET% *FUNCTION TCATEGORY=%CATEGORY_TO_SET% *FUNCTION TDATASRC=%DATASRC_TO_SET% *FUNCTION TENTITY=%ENTITY_TO_SET% *FUNCTION TTIME=%TIME_TO_SET% *FUNCTION TYEARS=%YEARS_TO_SET%)
    TASK(Execute formulas,USER,%USER%)
    TASK(Execute formulas,APPSET,%APPSET%)
    TASK(Execute formulas,APP,%APP%)
    TASK(Execute formulas,SELECTION,%SELECTIONFILE%)
    TASK(Execute formulas,LOGICFILE,%APPPATH%\..\AdminApp\%APP%\_TEST.LGF)
    TASK(Execute formulas,RUNMODE,1)
    TASK(Execute formulas,LOGICMODE,1)
    Then one will be able to use the functions TACCDETAIL, TCATEGORY, TACCOUNT,... in the logic script.
    Edited by: ALEXANDRE BEDIER on Jun 24, 2010 10:31 AM
    Edited by: ALEXANDRE BEDIER on Jun 24, 2010 10:33 AM

  • How do I turn an image into a transparency?

    Hi,
    There's a question I've seen asked dozens or hundreds of times, and I thought I found an answer a few years ago. I've since forgotten how to do it:
    Turn an image into a transparency.
    Now, the obvious solution is to set the layer to "multiply." Yes, this is the effect I want. However, I want the layer to be transparent instead.
    Another solution is to draw an image on a transparent layer. This works great, but only applies if I create the image from scratch. I want to convert an existing image.
    Another solution is multiple steps:
    1) Copy image
    2) Click "edit in quick mask mode."
    3) Paste image
    4) Exit quick mask mode.
    5) Invert selection.
    6) Ctrl+backspace to fill selection with black, on a blank transparent layer.
    Result? The image is now transparent! However, this converts the image to greyscale! Great for linework and text, terrible for photos or art!
    In an older version of Photoshop 7, I believe I got the following to work:
    A) Follow the previous steps 1-6, creating a layer with transparency
    B) Copy the original picture to a layer above the transparency
    C) Group the layer with the transparency layer below. (Note, grouping doesn't work the same any more.)
    D) The top layer provides the colors, but the bottom layer provides the transparency.
    E) It is too light, so you take the top layer, and maximize "saturation" 100%.
    F) Merge the two layers. It retains the transparency of the bottom layer, with the hue of the top layer.
    This no longer works, because I don't know how grouping layers works anymore.
    So, I need white pixels to be transparent. Black pixels to have zero transparency. Red pixels to have zero transparency. Etc.
    Meanwhile, grey pixels are solid black, but partly transparent. Pink pixels are solid red, but partly transparent.
    All pixels are 100% saturated, and the "lightness" is determined by how transparent they are.
    So, an analogy would be printing a photo on a transparency. I need to convert an image to a transparency.
    If the image/layer were overlaid on white, it would look exactly like the original photo.
    Does anyone know how to accomplish this? Mathematically, it's easy. But I don't know about any filter, process, or method to make the conversion using CS5.
    Thanks,
    Ben

    Hello!
    I hope that I understand what you need.
    (One could just put the image on a layer, and lower its opacity, but you seem to be looking for an effect in wich the tranparency is not the same for all pixels.)
    Try this:
    1) Turn your image image as a layer (double-click it if it is a background layer) [In order to add a mask]
    2) Select all, Copy (CTRL+a, CTRL+C)
    3) add a layer mask (click the rectangle with a circle in the bottom of the layers panel) [to be able to change transparency]
    4) target the mask [so that you can past an image in it] ALT+click the mask, paste the image.
    5) Invert the colors of the mask (CTRL+I) [in order for the white to be transparent and the black opaque].
    You now have a layer whose transparency is based on the lightness of the pixels.
    Hope that's what you are after!
    Pierre

  • How to insert data from file into matlab script node

    I have interfaced input data from file to be processed using matlab script node. But the problem is that I could not capture the multiple data into matlab script node and to convert it into matrix. Further to this I need to process the data by plotting graphs from it. Thank you in advance for the advice

    Zarina,
    To clarify your problem, you have a script node contaning your Matlab code. Are you then using the standard LV functions to load in your data from a file and pass it into the script node?
    Regards
    Tristan

  • Mail turns PDF attachment into jepg

    I use distiller and acrobat to create PDFs from Quark documents; for the last few days, attaching a new PDF to an email in Mail has turned the PDF into a jpeg which PC users can't open. The problem has just cleared itself (without me knowingly doing anything) but it has happened before and I guess may happen again. Any idea of the cause and solution?

    What I should have said is Apple should not make the Image Size adjustment an available option when a PDF file is attached to a message.
    Yes, this is the answer. Using the term seemed to happen - it either happens or it doesn't but Mail will not and cannot change the file type or the file extension for an attached file without user intervention. Using the Image Size adjustment for a single page PDF file which appears inline or viewed in place within the body of the message does change the file type or file extension for the file from .pdf to .jpg since the Image Size adjustment is intended and can only be used for picture or image file attachments, not with PDF files.

  • Need to turn this PLSQL into a procedure

    Hi All,
    I have the following PLSQL which declares a cursor, then loops using the cursor variable. I'm new to creating procedures and packages and i'm having trouble turning this PLSQL into one of those. When i put my PLSQL code in a procedure it doesn't like the DECLARE statement or the CURSOR section. I'm not sure how to tweak it to get the syntax correct for a procedure. Can someone point me in the right direction?
    Here is the PLSQL:
    DECLARE
    /* Output variables to hold the result of the query: */
    groupid assignment_group.id%TYPE;
    /* Cursor declaration: */
    CURSOR Asset_Rank_HistoryCursor IS
    select distinct id from assignment_group;
    BEGIN
    OPEN Asset_Rank_HistoryCursor;
    LOOP
    /* Retrieve each row of the result of the above query into PL/SQL variables: */
    FETCH Asset_Rank_HistoryCursor INTO groupid;
    /* If there are no more rows to fetch, exit the loop: */
    EXIT WHEN Asset_Rank_HistoryCursor%NOTFOUND;
    /* Insert the the new rows */
    insert into ASSET_RANK_GROUPED (asset_id , dt, rank, score, ASSIGNMENT_GROUP_ID)
    select asset_id, max_dt, rownum, score, groupid from (
    SELECT <big nasty select statement>
    END LOOP;
    /* Free cursor used by the query. */
    CLOSE Asset_Rank_HistoryCursor;
    END;
    How do i change my DECLARE and CURSOR statement so the procedure will create. Do i need to break it out into a function?

    I figured it out... just had to play w/ the syntax. Had to make sure the BEGIN statement was AFTER the CURSOR declaration and had to make sure any variables are declared up top, didn't need a DECLARE section in procedure. I just put the groupid variable right after IS at the top of procedure creation statement.

  • I made a picture collage in pages from the pictures in iPhoto.  You used to be able to print and then say save as a jpeg to iPhoto and that option is gone.  How do you turn your document into a jpeg now.

    I made a picture collage in pages from the pictures in iPhoto.  You used to be able to print and then say save as a jpeg to iPhoto and that option is gone.  How do you turn your document into a jpeg now?

    If you chose print, you can save as PDF. If you open the saved PDF in preview, you can save as JPEG, GIF, PNG. FYI you can crop in preview.
    Another option is you could use command + shift + 4 to do a screen shot of a specific part of of the screen.

  • How to pass a parameter into RMAN script

    Hello,
    I have the following rman script :
    run {
    CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    CONFIGURE CONTROLFILE AUTOBACKUP OFF;
    CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\ora_df%t_s%s_s%p';
    This script called configure.rman is launch by a .bat script with the following command:
    rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman
    How can I pass a parameter into rman script, I want to pass an additional directory like this:
    rman target 'sys/sys12@ORCL102 as sysdba' @c:\oracle\RmanORCL102\configure.rman v_dir_name
    And use it in rman script:
    CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\$v_dir_name\ora_df%t_s%s_s%p';
    Is it a way to do this?
    Regards,
    Elodie

    One option would be to create a file called backup.bat with the following:
    echo run {
    echo CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
    echo CONFIGURE CONTROLFILE AUTOBACKUP OFF;
    echo CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
    echo CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT 'c:\oracle\RmanORCL102\%1\ora_df%t_s%s_s%p';
    echo } ) | rman target sys/sys12@orcl102and then call the script as:
    c:\> backup.bat backup_directory_name

  • What peripherals do you need to turn your iPhone into a conference room speakerphone?

    What peripherals do you need to turn your iPhone into a conference room speakerphone system?
    If you buy a separate conference mic and a speaker, can they somehow work together off the iPhone headphone jack like a huge set of group earphones?  What if you want to connect 2 mics and a speaker?
    Do you have to be very careful that they can all be attached somehow at the same time?
    Are there reasonably priced conference room speakerphone peripherals the work well together that you would recommend?
    Steve

    Why don't you contact Apple and find out?  Certainly if you can find your way around the internet to have been able to find this forum, you can certainly find the number for AppleCare.

  • Turning PDF Documents into Word Documents

    Can I use my Adobe Creative Suite 6 to turn PDF documents into Word Documents?

    Acrobat comes with most versions of Creative Suite and it is capable of converting PDFs to Word documents. The quality of the results depend on a number of things. If the PDF was originally generated from a Word source and it's well tagged, you will get much better results. More complicated layouts will generally have worse results and there will be considerable cleanup in Word needed. Exporting to text is sometimes better.
    For the future, there is a better forum for this type of question: http://forums.adobe.com/community/acrobat/creating__editing_%26_exporting_pdfs?view=discus sions

Maybe you are looking for