<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:georss="http://www.georss.org/georss" xmlns:media="http://search.yahoo.com/mrss/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0">

<channel>
	<title>SharePoint Dave</title>
	<atom:link href="https://blog.davidjwise.com/feed/" rel="self" type="application/rss+xml"/>
	<link>https://blog.davidjwise.com</link>
	<description>Thoughts and comments from deep in the SharePoint jungle.</description>
	<lastBuildDate>Thu, 13 Oct 2016 16:56:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>

<image>
	<url>https://blog.davidjwise.com/wp-content/uploads/2018/12/cropped-mirroredclouds_345x240.jpg?w=32</url>
	<title>Developing Thoughts</title>
	<link>https://blog.davidjwise.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">24311958</site><cloud domain="blog.davidjwise.com" path="/?rsscloud=notify" port="80" protocol="http-post" registerProcedure=""/>
<atom:link href="https://blog.davidjwise.com/osd.xml" rel="search" title="Developing Thoughts" type="application/opensearchdescription+xml"/>
	<atom:link href="https://blog.davidjwise.com/?pushpress=hub" rel="hub"/>
	<xhtml:meta content="noindex" name="robots" xmlns:xhtml="http://www.w3.org/1999/xhtml"/><item>
		<title>The Elusive Microsoft ULS Viewer</title>
		<link>https://blog.davidjwise.com/2014/09/16/ulsviewerfound/</link>
					<comments>https://blog.davidjwise.com/2014/09/16/ulsviewerfound/#respond</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Tue, 16 Sep 2014 23:00:00 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=4108</guid>

					<description><![CDATA[If you do any amount of work in SharePoint then you&#8217;ve probably needed to dive into the ULS logs at some point. Once there, you realized that working in those using a simple text editor results in nothing but frustration.  At which point, you probably went looking for a tool to make the ULS insanity &#8230; <a href="https://blog.davidjwise.com/2014/09/16/ulsviewerfound/" class="more-link">Continue reading <span class="screen-reader-text">The Elusive Microsoft ULS Viewer</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>If you do any amount of work in SharePoint then you&#8217;ve probably needed to dive into the ULS logs at some point. Once there, you realized that working in those using a simple text editor results in nothing but frustration.  At which point, you probably went looking for a tool to make the ULS insanity go away &#8230; or at least to make it <span id="more-4108"></span>manageable.  Prior to May of 2014, the best tool out there was the free Microsoft ULS Viewer (ULSViewer.exe) which was a single file with no installer and ran on everything from Windows XP to Server 2012.  The old URL was <a href="http://code.msdn.microsoft.com/ULSViewer/" rel="nofollow">http://code.msdn.microsoft.com/ULSViewer/</a> but that is merely a redirect now.</p>
<p><del>Unfortunately, Microsoft retired that entire site and only provided links for a <a href="http://archive.msdn.microsoft.com/">smattering of the utilities</a> that were present and ULS Viewer was not one of those listed.  This left the SharePoint community with no &#8216;official&#8217; place to get the ULS Viewer.  A few bloggers have since added it to their sites just so that it is at least available in some form but there are no assurances that they have not tampered with the files or even that the files have been properly virus scanned.  Not something you want to put on a client&#8217;s servers&#8230; Others in the community have attempted to write their own ULS viewers but these generally fall far short of the capabilities the old and free utility provided.</del> <strong>Microsoft is supporting this again and has put the updated version on their <a href="https://www.microsoft.com/en-us/download/details.aspx?id=44020">Downloads</a> site.</strong></p>
<p>I contacted Microsoft several weeks ago and they have now added the official executable for the ULS Viewer on the Archive&#8217;s <a href="https://onedrive.live.com/?cid=38EB61838A7224E1&amp;id=38EB61838A7224E1%21105">OneDrive </a>folder.  There are a number of other utilities and samples there as well but the ULS Viewer was my only concern.  The files and links did come from Microsoft so this is as official as it can get given the circumstances.  I&#8217;m hoping they eventually put the file and the source code up on the code.msdn.microsoft.com site but am not going to hold my breath.</p>
<p><a href="https://onedrive.live.com/?cid=38EB61838A7224E1&amp;id=38EB61838A7224E1%21105">https://onedrive.live.com/?cid=38EB61838A7224E1&amp;id=38EB61838A7224E1%21105</a></p>
<p>Hope this helps!</p>
<p>Update: It seems that another user took the time to compile everything he had on ULS Viewer and put it up on the <a href="https://gallery.technet.microsoft.com/ULS-Viewer-952c025d">MSDN Technet Gallery</a> so perhaps we will have a stable place to find it until it simply doesn&#8217;t work  or Microsoft decides to release it to the Open Source community.</p>
<p><strong>Big Update!</strong>  It seems Microsoft is now supporting this again and has published an updated version on their <a href="https://www.microsoft.com/en-us/download/details.aspx?id=44020">Downloads</a> site.  The UI is a slightly different and I haven&#8217;t had a chance to work with it in the real world yet but it looks promising.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2014/09/16/ulsviewerfound/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4108</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>A List of All Changes in the October 2013 Cumulative Update</title>
		<link>https://blog.davidjwise.com/2013/12/04/october-2013-cu/</link>
					<comments>https://blog.davidjwise.com/2013/12/04/october-2013-cu/#respond</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Thu, 05 Dec 2013 00:19:54 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Cumulative Update]]></category>
		<category><![CDATA[patch]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=1666</guid>

					<description><![CDATA[It is Cumulative Update time again and so Microsoft has once more attempted to make tracking down the specifics of what has been changed or updated to as difficult as possible. This post is just a single place that pulls together all of the changes in the October 2013 CU in one place instead of &#8230; <a href="https://blog.davidjwise.com/2013/12/04/october-2013-cu/" class="more-link">Continue reading <span class="screen-reader-text">A List of All Changes in the October 2013 Cumulative Update</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>It is Cumulative Update time again and so Microsoft has once more attempted to make tracking down the specifics of what has been changed or updated to as difficult as possible. This post is just a single place that pulls together all of the changes in the October 2013 CU in one place instead of scattered across <span id="more-1666"></span>half a dozen pages with links to pages that link to other pages.</p>
<p>I do have to give Microsoft some credit though as <a href="http://blogs.technet.com/b/steve_chen/archive/2013/10/11/3601917.aspx" target="_blank">this announcement</a> is better organized than previous ones and provides a nice jump off point to find all of the changes.  There is still a lot of digging but it is a good starting point.</p>
<h1>SharePoint Foundation 2013</h1>
<h2>Sts-x-none.msp</h2>
<p><a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;2825674" target="_blank">2825674</a> &#8211; Updates to build: 15.0.4551.1001</p>
<ul>
<li>When you use a publishing template on a SharePoint Server 2013 site, you cannot add a search box to the XsltListViewWebParts web part.</li>
<li>Assume that a blog contains more than eleven entries. When you go to the next page of the blog in the Archives view, the title of the page is displayed incorrectly. Additionally, you may receive the following error message:
<ul>There are no posts in this month.</ul>
</li>
<li>When you try to join a custom group on a SharePoint Server 2013 site, you may receive the following error message:
<ul>Sorry something went wrong.</ul>
</li>
<li>When you are a search service administrator on a SharePoint Server 2013 farm, you cannot click the <strong>Query Rules</strong> button under the <strong>Queries and Results</strong> heading in the Navigation pane to view query rules.</li>
<li>Assume that you do not install or enable the DragUpload ActiveX control in Windows Internet Explorer 8 or Internet Explorer 9. When you click the <strong>New document</strong> button on a SharePoint Server 2013 document library, Microsoft InfoPath does not start.</li>
<li>When you follow a document on a SharePoint Server 2013 site that has alternate access mappings (AAM) enabled, the link to the document points to the default zone instead of the AAM zone.</li>
<li>After you use SharePoint Designer 2013 to add a Dataform web part to a SharePoint Server 2013 page and enable grouping on one or more fields, you cannot expand or collapse the group.</li>
<li>When you trigger an automatic approval workflow on a SharePoint Server 2013 site from a nondefault zone, the approval email message includes a URL that uses the default zone.</li>
<li>Assume that you add the Tag Cloud web part to a page on a SharePoint Server 2013 site that has the <strong>Save metadata on this list as social tags</strong> feature enabled. When you try to add a term in the <strong>Enterprise Keywords</strong> column for an item, the term is not added, and no tag is displayed on the Tag Cloud web part.</li>
<li>Consider the following scenario:
<ul>
<li>You create a SharePoint Server 2013 document library that has the versioning and &#8220;required check out&#8221; features enabled.</li>
<li>You upload a document to the document library.</li>
<li>You check in the document and leave a version comment.</li>
<li>You open the version history of the document.</li>
</ul>
<p>In this situation, the version comment that you left is blank.</li>
<li>The number of downloads is not removed from the details page of an app.</li>
<li>Assume that you enable the WOPI Binding feature for a .pdf file on a SharePoint Server 2013 server. When you click the <strong>Open</strong> button on the .pdf file callout, you receive an error message.</li>
<li>When you add a client-side connected web part that provides data to a consumer web part on a SharePoint Server 2013 site, the web part does not work in Internet Explorer 10.</li>
<li>Assume that you create a SharePoint Server 2013 site that contains a Managed Metadata Service (MMS) column. When you use the multiple file upload control to upload a document to the site, the values for calculated columns are not populated.</li>
<li>When you change the Ipersonalizable property of a web part on a SharePoint Server 2013 site, the property is not saved correctly.</li>
</ul>
<p>Additionally, this update adds a new IT control to the SharePoint Designer client. The control helps you migrate workflows from WF3 workflows to WF4 workflows.</p>
<h1>SharePoint Server 2013</h1>
<p><a href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;2825647" target="_blank">2825647</a> &#8211; Updates to build: 15.0.4551.1005</p>
<ul>
<li>When you assign a task to a user whose display name contains a comma on a SharePoint Server 2013 site, you receive the following error message:
<ul>The user does not exist or is not unique.</ul>
</li>
<li>After you use SharePoint Designer 2013 to add a Dataform web part to a SharePoint Server 2013 page and enable grouping on one or more fields, you cannot expand or collapse the group.</li>
<li>The language selection drop-down list on the search page does not extended fully.</li>
<li>Consider the following scenario:
<ul>
<li>You create a SharePoint Server 2013 document library that has the Versioning and Required Check Out features enabled.</li>
<li>You upload a document to the document library.</li>
<li>You check in the document and then leave a version comment.</li>
<li>You check the version history of the document.</li>
</ul>
<p>In this situation, the version comment is blank.</li>
<li>Consider the following scenario:
<ul>
<li>You create a grouping view for a list that contains a managed metadata service field on a SharePoint Server 2013 site.</li>
<li>You expand all nodes for the list.</li>
<li>You apply a filter to the managed metadata service field.</li>
</ul>
<p>In this situation, all items are missing.</p>
<p><b>Note</b> This issue occurs even after you clear the filter.</li>
<li>Assume that you create a new workflow that executes many input or output (I/O) operations on a SharePoint Server site by using SharePoint Designer 2013. Then, you publish the workflow and trigger an instance. When you browse through the workflow status page, you receive the following error message:
<ul>System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.</ul>
</li>
</ul>
<h2>Coreserver-x-none.msp</h2>
<p><a title="2825672" href="http://support.microsoft.com/kb/2825672" target="_blank">2825672</a></p>
<ul>
<li>When you are a search service administrator in a SharePoint Server 2013 farm, you cannot click <strong>Query Rules</strong> under the <strong>Queries and Results</strong> heading in the navigation pane to see query rules.</li>
<li>When you follow a document on a SharePoint Server 2013 site that has alternate access mappings (AAM) enabled, the link to the document points to the default zone instead of to the AAM zone.</li>
<li>When you use SharePoint Designer 2013 to add a Dataform web part to a SharePoint Server 2013 page and enable grouping on one or more fields, you cannot expand or collapse the group.</li>
<li>When you trigger an automatic approval workflow on a SharePoint Server 2013 site from a nondefault zone, the approval email message includes a URL that uses the default zone.</li>
<li>When you add a note board web part to a web part zone on a SharePoint Server 2013 site, web part zones on the right side of the page are unexpectedly moved down the page.</li>
<li>When you post a link for a file that contains more than 16 Unicode Transformation Format (UTF) characters on the Newsfeed page, you receive the following error message:This couldn&#8217;t be posted because we&#8217;re having some issues at the moment.</li>
<li>Assume that you add the Tag Cloud web part to a page on a SharePoint Server 2013 site that has the <strong><b>Save metadata on this list as social tags</b></strong> feature enabled. When you try to add a term in the <strong><b>Enterprise Keywords</b></strong> column for an item, the term is not added, and no tag is displayed on the Tag Cloud web part.</li>
<li>Consider the following scenario:
<ul>
<li>You create a SharePoint Server 2013 document library that has the versioning and &#8220;required check out&#8221; features enabled.</li>
<li>You upload a document to the document library.</li>
<li>You check in the document and leave a version comment.</li>
<li>You open the version history of the document.</li>
</ul>
<p>In this situation, the version comment is blank.</li>
<li>You cannot use the asset picker to add an image to a page on a Catalonian SharePoint Server 2013 site.</li>
<li>Consider the following scenario:
<ul>
<li>You create a Team Site web application and a My Site web application that use different host names.</li>
<li>You follow up a post on a Team Site.</li>
<li>You click the link in the <strong>Added a follow up task to your task list</strong> dialog box to view your task.</li>
</ul>
<p>In this situation, you are not redirected to the My Site site.</li>
<li>When you perform a crawl on a SharePoint Server 2013 site, and the site performs a redirect operation to a different page, you receive an error message that states that an object was not found.</li>
<li>Assume that you enable the Company Entity Extraction or Custom Extraction feature on a SharePoint Server 2013 site. When you perform a crawl on a list that contains some attachments, the crawl freezes and then times out.</li>
<li>When a site (site A) and your My Site site are hosted on different farms, you cannot follow people or content on the Newsfeed page on site A.</li>
<li>Consider the following scenario:
<ul>
<li>You create a source label and a target variation label on a SharePoint Server 2013 site.</li>
<li>You run the Variations Create Hierarchies Job Definition job to enable hierarchies.</li>
<li>You create a list under a sub-site that is under the source variation.</li>
<li>You run the Variations Propagate Sites and Lists Timer job to enable propagation.</li>
<li>You click a hyperlink in the status column on the variation settings page for the list.</li>
</ul>
<p>In this situation, you receive an error message that states the list does not exist.</li>
<li>When you search some words by using the Enterprise Search Center site on a SharePoint Server 2013 server on which a custom word breaker is installed, no words are highlighted.</li>
<li><a href="http://support.microsoft.com/kb/2826001">2826001</a>
<ul>&#8220;We’ve hit a snag&#8221; error message when a user clicks the Followed Sites or Followed Documents button in a consuming SharePoint Server 2013 farm</ul>
</li>
<li>When you change the search topology and remove the replicas on a SharePoint Server 2013 server, the disk is accumulated and is eventually filled up.</li>
</ul>
<h2>Coreserver-x-none.msp; Coreservermui-&lt;Language-Code&gt;.msp</h2>
<p><a title="2825675" href="http://support.microsoft.com/kb/2825675" target="_blank">2825675</a></p>
<ul>
<li>When you perform a full, incremental, or continuous crawl on a SharePoint Server 2013 site, the crawl stops, and no content is processed.</li>
<li>The language selection control on the Search Results page is not displayed as expected.</li>
</ul>
<h1>Office Web Apps Server 2013</h1>
<h2>Wacserver-x-none.msp</h2>
<p><a title="2825686" href="http://support.microsoft.com/kb/2825686" target="_blank">2825686</a></p>
<ul>
<li>Assume that Microsoft Lync 2013 is installed on a computer that is running Windows 8.1 or that has Windows Internet Explorer 11 installed. The computer is in an environment that uses an on-premises deployment of Office Web Apps Server 2013. When you try to share or view a Microsoft PowerPoint presentation in Lync 2013, the Loading indicator is displayed for longer than expected. Or, you receive the following error message:Sorry, we ran into a problem displaying the presentation. Please try again.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/12/04/october-2013-cu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1666</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>Calling a SharePoint Web Service Returns ‘Error 400 Bad Request’</title>
		<link>https://blog.davidjwise.com/2013/11/05/spwebservice-400-error/</link>
					<comments>https://blog.davidjwise.com/2013/11/05/spwebservice-400-error/#comments</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Tue, 05 Nov 2013 14:30:12 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=1455</guid>

					<description><![CDATA[The other day an Asp.Net developer approached me with a problem he was seeing interacting with SharePoint. He had code in place for months that called the OData SharePoint web service and it worked perfectly. However, the data he was pulling was just moved from one Web Application to another and now his service was &#8230; <a href="https://blog.davidjwise.com/2013/11/05/spwebservice-400-error/" class="more-link">Continue reading <span class="screen-reader-text">Calling a SharePoint Web Service Returns &#8216;Error 400 Bad Request&#8217;</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>The other day an Asp.Net developer approached me with a problem he was seeing interacting with SharePoint.  He had code in place for months that called the OData SharePoint web service and it worked perfectly. However, the data he was pulling was just moved from one Web Application to another and now his service was returning &#8220;400 Bad Request&#8221; errors on the new URL.  Pointing the identical code back to the old location (because you never delete the old data right away &#8211; right?) worked perfectly.  Both the old and new web applications were in the same farm and both required <span id="more-1455"></span>Windows authentication in order to see the content &#8211; or so we thought.</p>
<p>After some digging around in the icky parts of SharePoint, I noticed that the new web application was configured to allow anonymous access to the web application itself because there was one site collection under managed sites that was configured to allow anonymous access.  The root site collection did not allow anonymous access and the URL to the web service was quite solidly in that site collection so it again looked like permissions should not be an issue.</p>
<p>We fired up Fiddler and noticed immediately that if we accessed the web service in a Internet Explorer 1) worked and 2) negotiated a windows authenticated session.  Firefox would fail with a generic &#8220;Request Error&#8221; message but would not even attempt to authenticate.  When we executed the C# code we saw that it always accepted the first connect attempt which was anonymous and thus the same behavior as we saw in Firefox.  No amount of fiddling with the code, meddling with credentialcache settings and so forth would change that.  </p>
<p>Here&#8217;s where the speculation begins&#8230; the web service page itself is under the /_vti_bin/ directory which is an alias that points to pages that exist outside of the site collection and in the file system of the server &#8211; 14/ISAPI in this case.  What I suspect was happening was that SharePoint parsed the URL, saw the /_vti_bin/ and handed the request off to the physical page rather than process it through the site collection&#8217;s security.  The page then loaded and attempted to access the requested list but since the list itself was secured, the page shrugged and failed with the &#8220;400 Bad Request&#8221; because it didn&#8217;t know what else to do.  A 404 is not proper because the page that was requested was in fact accessible, it was just underlying data that was not.  A &#8220;401 Unauthorized&#8221; was also not appropriate because as an anonymous user the page couldn&#8217;t even access enough of the site collection to determine permissions.  It was effectively a perfectly functioning door that opened into a brick wall &#8211; but only for anonymous users.</p>
<p>The &#8220;solution&#8221; was to call a page in the site collection that was secure and would thus force the proper authentication handshaking to take place, and then use that session to call the web service.  It is not optimal as it requires an additional server hit before calling the service itself so I would be open to any alternatives that I haven&#8217;t yet tried.  I tested every combination of security settings and .Net related objects I could think of and then googled until it cried for mercy &#8211; all without any luck.</p>
<pre class="brush: csharp; auto-links: false; light: true; title: ; notranslate">
void CallODataService()
{
	WebClient client = new WebClient();
	client.UseDefaultCredentials = true;

	Uri secPage = new Uri(&quot;http://webapp.company.com/Pages/Default.aspx&quot;);
	Uri svcUri = new Uri(secPage, &quot;/Region/State/_vti_bin/listdata.svc/Stores?$filter=endswith(Name,'.docx')&amp;$select=Name&quot;);

	// get an authenticated session
	client.DownloadString(secPage);

	// now call the service using the authenticated session
	string result = client.DownloadString(svcUri);
}
</pre>
<p>There is another mystery here though and that is that if I go back into Fiddler and look at the call to the web service that executes after the call to the secure page, it appears to pass almost no information whatsoever to the server.  No cookies, one header and almost nothing else.  Logically, this call should fail outright yet it works every time.  My thought on this is that the keep-alive time in IIS is holding the connection open for this client which, if true, might possibly cause an issue in a load balanced environment.  Again, this is just a shot in the dark though.  I&#8217;m also not ruling out the influence of rogue garden gnomes.</p>
<p>Hopefully, even this less than ideal solution will at least point anyone else seeing similar behavior toward the real issue and save them a day&#8217;s frustration.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/11/05/spwebservice-400-error/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1455</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>SharePoint as a Whipping Boy</title>
		<link>https://blog.davidjwise.com/2013/10/30/sharepoint-as-a-whipping-boy/</link>
					<comments>https://blog.davidjwise.com/2013/10/30/sharepoint-as-a-whipping-boy/#respond</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Wed, 30 Oct 2013 19:05:36 +0000</pubDate>
				<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=489</guid>

					<description><![CDATA[A &#8216;whipping boy&#8217; is an 15th century term for a boy who was designated to take the punishment when a prince or other such noble misbehaved so that the boy would be punished instead of the prince.  I&#8217;m not entirely certain what lessons this taught the young prince but my guess is that it was &#8230; <a href="https://blog.davidjwise.com/2013/10/30/sharepoint-as-a-whipping-boy/" class="more-link">Continue reading <span class="screen-reader-text">SharePoint as a Whipping Boy</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>A &#8216;whipping boy&#8217; is an 15th century term for a boy who was designated to <a href="http://www.phrases.org.uk/meanings/whipping-boy.html">take the punishment when a prince or other such noble misbehaved</a> so that the boy would be punished instead of the prince.  I&#8217;m not entirely certain what lessons this taught the young prince but my guess is that it was either 1) other people would be suffer for his mistakes so he should be responsible, or 2) that he would never be punished for anything so he was free to do anything he wanted. It would probably depend on how moral or empathetic the prince was or even if he cared about the boy being punished.  You might be surprised at how a dark ages royal parenting strategy applies almost directly to SharePoint.</p>
<p>SharePoint continues to move itself closer and closer to being the center of the business world and with each new release extends its fingers even deeper into<span id="more-489"></span> almost everything in the enterprise.  As such, people are interacting with it so often that they are unable to distinguish between what parts are SharePoint and what parts are external systems.  This is good or bad, depending on your point of view.  It is good that people are relying on it but bad that they are not able to distinguish even obvious lines of demarcation.  This blurred line results in SharePoint taking the heat for any and all problems that use SharePoint in any way, even just as a place for hyperlinks.  In short, it becomes the Whipping Boy, taking the punishment for the failings of another.</p>
<p>Case in point: a few weeks ago a call came in that &#8216;SharePoint was down&#8217; except that it wasn&#8217;t and had not actually been &#8216;down&#8217; outside of the scheduled maintenance window in years.  It turned out that one of the pages deep in the site on &#8216;sharepoint.ourcompany.com&#8217; had a hyperlink to &#8216;outsidevendor.com&#8217; and that other site was the one that was returning a &#8216;404: Not Found&#8217; error.  A simple look at the address bar by either the user or the help desk would have spotted this but it was instead routed to higher level SharePoint support.  The issue was cleared up quickly by contacting the owner of the page within SharePoint and having them correct the link but this was hardly the first time such a mistake has been made.  In fact, it happens so often that we&#8217;ve accepted the position that SharePoint is &#8220;guilty until proven innocent&#8221; in the minds of most people in the company.</p>
<p>Other recent examples of the &#8216;whipping boy&#8217; in action:</p>
<ul>
<li>SharePoint alerts are being sent from the wrong email address! (a security patch was made to Exchange that forces emails to use the defined &#8220;from&#8221; name on the email account instead of using the site specific &#8220;from&#8221; name that SharePoint sends)</li>
<li>I can&#8217;t print PowerPoint files when I download them from SharePoint! (an IE/Office misconfiguration that happens when the PowerPoint files are loaded from any website in the company)</li>
<li>I&#8217;m not getting any SharePoint alerts! (the user had rules defined in Outlook to delete all SharePoint alerts when they arrived)</li>
<li>SharePoint performance is horrible! (a network device in the data center was misconfigured, crippling all network traffic from several server racks not just SharePoint.  SharePoint was simply the more widely used)</li>
<li>and so on and so forth</li>
</ul>
<p>None of these problems are SharePoint&#8217;s fault, but all are blamed on SharePoint at least initially because that is where the interaction started and this has a negative impact on the perception of the product itself.  This can be a big deal around budget time as upper management comes to see the product as either unreliable or unpredictable and is much more willing to question the funding associated with it.  Common solutions to this problem are to either educate senior management, keep excessive &#8220;CYA&#8221; documentation to present when questioned, or impose the draconian step of implementing a &#8220;you are now leaving SharePoint&#8221; style dialog that is almost universally despised.  I do have some other suggestions on this that I will get to later.</p>
<p>To further complicate this, SharePoint 2013 has introduced a <a href="http://msdn.microsoft.com/en-us/library/office/apps/fp179930.aspx" target="_blank">new application model</a> that brings with it applications that are embedded within a SharePoint page so well that users can&#8217;t even see that it is separate from SharePoint at all.  How do we position those so that users can understand the line between SharePoint itself and the underlying applications that may even be hosted by completely different companies?  Do we merely accept that SharePoint will be blamed for any application outages, even though SharePoint itself has nothing to do with those outages? Do we simply lump it all under the SharePoint banner and try to do damage control as the situations arise? Do we create the mother of all paper trails so that we can look at each outage and prove that it wasn&#8217;t really SharePoint?</p>
<p>Frankly, all of these options are pretty ugly.  Education is normally the answer to these types of problems but SharePoint is so large that the learning curve for anything beyond basic usage is already so steep for the average user that things like this would just get lost in the mix and forgotten.  Especially since it is so rarely an issue encountered in most people&#8217;s day to day interactions with the tool.</p>
<p>I know people are going to be upset with me for this but I feel that the best approach is what is the best for the users, which is to blame SharePoint first.  We know SharePoint isn&#8217;t usually responsible for these things but that is the perspective the users are coming from and trying to force them to understand more than that not only places an unfair and unwanted burden on them but sounds like whining on our part.  The user called because they have a problem and, like it or not, we have the tools and the depth of knowledge to troubleshoot and diagnose the actual problem and we can get the process of resolving the issue in motion.  The user came to us with a problem and we were able to solve it &#8211; that sounds like a good outcome to me!</p>
<p>This solves the problem for the user but still leaves us with the larger problem of SharePoint gaining a negative reputation across the company.  The obvious first step is simple openness about the state of the application.  Make sure all key benchmarks are posted and visible, including not only uptime but also ticket resolution that shows a breakdown of where the actual problem was.  If this information is presented occasionally to the organization in some form, it will help mitigate the reputation damage.  </p>
<p>This approach still feels like playing defense though where we are constantly fighting just to hold ground.  Instead, we should go on &#8216;offense&#8217; and take control of the source of those negative impressions by putting on our Ultimate Customer Service hat and taking steps to go above and beyond normal ticket resolution. Ensure that the whole process related to solving a user&#8217;s problems is so positive and so thorough that the users eventually become happier when the SharePoint team takes over an issue because they know that it is now in good hands.  In this way, the very people who would have become your greatest detractors now become your greatest champions.  </p>
<p>If you have other ideas or suggestions on this topic, I&#8217;d love to hear them!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/10/30/sharepoint-as-a-whipping-boy/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">489</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>Use PowerShell to Remove an Orphaned Custom Site Template from SharePoint 2010</title>
		<link>https://blog.davidjwise.com/2013/05/06/use-powershell-to-remove-an-orphaned-custom-site-template/</link>
					<comments>https://blog.davidjwise.com/2013/05/06/use-powershell-to-remove-an-orphaned-custom-site-template/#comments</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Tue, 07 May 2013 00:53:26 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[SP2010]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=513</guid>

					<description><![CDATA[A situation cropped up today where a custom Site Template was created by saving a site as a template which was then used and subsequently deactivated and then deleted. Simple enough except that SharePoint insisted that the template was still there and presented it as a choice when creating new sites even though it didn&#8217;t &#8230; <a href="https://blog.davidjwise.com/2013/05/06/use-powershell-to-remove-an-orphaned-custom-site-template/" class="more-link">Continue reading <span class="screen-reader-text">Use PowerShell to Remove an Orphaned Custom Site Template from SharePoint 2010</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>A situation cropped up today where a custom Site Template was created by saving a site as a template which was then used and subsequently deactivated and then deleted.  Simple enough except that SharePoint insisted that the template was still there and presented it as a choice when creating new sites even though it didn&#8217;t exist and would fail if someone clicked on it.</p>
<p>I could have simply gone into <em>Site Settings &#8211; Page Layouts and Site Templates</em> and hidden it there but that raises other problems as well as adds ongoing maintenance as it means all new templates would have to be explicitly added in order to be visible.  However, even if I did that<span id="more-513"></span>, it still doesn&#8217;t solve the underlying issue of having a corrupt Site Template in the system.   A search showed lots of people with the exact same issue and all without any resolutions.</p>
<p>The key thing that unlocked this was realizing that when SharePoint creates a web template, it creates both the template (as a solution) and a hidden feature that represents it.  In our case, the solution was gone (even from the Recycle Bin) but the feature lived on in sort of a half zombie state, being both alive and dead at the same time.</p>
<p>I came up with the script below to actually get rid of the web template feature and hope it helps others!</p>
<pre class="brush: powershell; auto-links: false; light: true; title: ; notranslate">
$templateTitle = &quot;TitleOfTemplateToBeZapped&quot;
 
$site = Get-SPSite http://domain.com/sites/SiteColRoot
 
$templates = $site.GetWebTemplates(1033) #lcid, 1033 = U.S. 
 
$badTemplate = $templates | where { $_.Title -eq $templateTitle }
 
if ($badTemplate -ne $null) {
    # the hidden feature Id is the first part of the template 
    #    name for custom web templates
    $id = $badTemplate.Name.substring(0, $badTemplate.Name.IndexOf(&quot;#&quot;))
    $badId = [System.Guid]($id)
    
    $site.Features.Remove($badId)
    write-output &quot;Template '$templateTitle' has been removed&quot;
} else {
    write-output &quot;No template was found with the title of '$templateTitle'&quot;
}
 
$site.Dispose()
</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/05/06/use-powershell-to-remove-an-orphaned-custom-site-template/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">513</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>Upload Files to SharePoint using PowerShell</title>
		<link>https://blog.davidjwise.com/2013/05/02/upload-files-to-sharepoint-using-powershell/</link>
					<comments>https://blog.davidjwise.com/2013/05/02/upload-files-to-sharepoint-using-powershell/#comments</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Thu, 02 May 2013 20:17:14 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[batch]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Upload]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=523</guid>

					<description><![CDATA[SharePoint admins occasionally have write PowerShell scripts to regularly extract some type of summary data from the SharePoint farm and then write that out to a file, usually in CSV format since PowerShell handles those so well. This is great for admins because we can just log onto the box and open the file to &#8230; <a href="https://blog.davidjwise.com/2013/05/02/upload-files-to-sharepoint-using-powershell/" class="more-link">Continue reading <span class="screen-reader-text">Upload Files to SharePoint using PowerShell</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>SharePoint admins occasionally have write PowerShell scripts to regularly extract some type of summary data from the SharePoint farm and then write that out to a file, usually in CSV format since PowerShell handles those so well. This is great for admins because we can just log onto the box and open the file to read the data, but what about the rest of the SharePoint team that also needs that data? <span id="more-523"></span></p>
<p>The obvious and &#8220;SharePointy&#8221; solution is to upload the CSV files to a SharePoint document library so that others on the team can easily access the data whenever they want and then use Excel to slice it to their heart&#8217;s content. However, there is a problem: PowerShell has no way of uploading those files into SharePoint! Even if it did, SharePoint document libraries have so many configuration possibilities that it could get hairy quickly.</p>
<p>I wrote the script below to get around that. It can be called from other scripts and allows for:</p>
<ul>
<li>Major and Minor Versioning</li>
<li>Check Out (if required)</li>
<li>Check In with comment</li>
<li>Approval with comment (if required)</li>
<li>Usage of the original file&#8217;s timestamps for SharePoint&#8217;s Created/Modified fields
<p><em>Check In and Approval updates the Modified date so that the file date will not be reflected in those cases</em></li>
</ul>
<p>The script is still a little rough but seems to work for most cases.</p>
<style>.gist table { margin-bottom: 0; }</style><div style="tab-size: 8" id="gist5495616" class="gist">
    <div class="gist-file" translate="no" data-color-mode="light" data-light-theme="light">
      <div class="gist-data">
        
<div class="js-gist-file-update-container js-task-list-container">
      <div id="file-upload-filetosharepoint-ps1" class="file my-2">
    
    <div itemprop="text"
      class="Box-body p-0 blob-wrapper data type-powershell  "
      style="overflow: auto" tabindex="0" role="region"
      aria-label="Upload-FileToSharePoint.ps1 content, created by DavidWise on 02:36PM on May 01, 2013."
    >

        
<div class="js-check-hidden-unicode js-blob-code-container blob-code-content">

  <template class="js-file-alert-template">
  <div data-view-component="true" class="flash flash-warn flash-full d-flex flex-items-center">
  <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
    <span>
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      <a class="Link--inTextBlock" href="https://github.co/hiddenchars" target="_blank">Learn more about bidirectional Unicode characters</a>
    </span>


  <div data-view-component="true" class="flash-action">        <a href="{{ revealButtonHref }}" data-view-component="true" class="btn-sm btn">    Show hidden characters
</a>
</div>
</div></template>
<template class="js-line-alert-template">
  <span aria-label="This line has hidden Unicode characters" data-view-component="true" class="line-alert tooltipped tooltipped-e">
    <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" data-view-component="true" class="octicon octicon-alert">
    <path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path>
</svg>
</span></template>

  <table data-hpc class="highlight tab-size js-file-line-container" data-tab-size="4" data-paste-markdown-skip data-tagsearch-path="Upload-FileToSharePoint.ps1">
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L1" class="blob-num js-line-number js-blob-rnum" data-line-number="1"></td>
          <td id="file-upload-filetosharepoint-ps1-LC1" class="blob-code blob-code-inner js-file-line">param(</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L2" class="blob-num js-line-number js-blob-rnum" data-line-number="2"></td>
          <td id="file-upload-filetosharepoint-ps1-LC2" class="blob-code blob-code-inner js-file-line">    [string] $listUrl = $null, # = &quot;<a href="http://bad.domain.xyz/Path&#038;quot" rel="nofollow">http://bad.domain.xyz/Path&#038;quot</a>;, </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L3" class="blob-num js-line-number js-blob-rnum" data-line-number="3"></td>
          <td id="file-upload-filetosharepoint-ps1-LC3" class="blob-code blob-code-inner js-file-line">    [string] $file = $null, # = &quot;C:\SomeFolder\SomeFile.txt&quot;,</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L4" class="blob-num js-line-number js-blob-rnum" data-line-number="4"></td>
          <td id="file-upload-filetosharepoint-ps1-LC4" class="blob-code blob-code-inner js-file-line">    [string] $checkInComment = &quot;Background Process Upload&quot;,</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L5" class="blob-num js-line-number js-blob-rnum" data-line-number="5"></td>
          <td id="file-upload-filetosharepoint-ps1-LC5" class="blob-code blob-code-inner js-file-line">    [bool] $publishMajorVersion = $true,</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L6" class="blob-num js-line-number js-blob-rnum" data-line-number="6"></td>
          <td id="file-upload-filetosharepoint-ps1-LC6" class="blob-code blob-code-inner js-file-line">    [bool] $approve = $true, # approve it if if approval is required</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L7" class="blob-num js-line-number js-blob-rnum" data-line-number="7"></td>
          <td id="file-upload-filetosharepoint-ps1-LC7" class="blob-code blob-code-inner js-file-line">    [string] $approvalComment = &quot;Approved by background process&quot;,</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L8" class="blob-num js-line-number js-blob-rnum" data-line-number="8"></td>
          <td id="file-upload-filetosharepoint-ps1-LC8" class="blob-code blob-code-inner js-file-line">    [bool] $useFileTimes = $false # use the original file times for SharePoint created/modified</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L9" class="blob-num js-line-number js-blob-rnum" data-line-number="9"></td>
          <td id="file-upload-filetosharepoint-ps1-LC9" class="blob-code blob-code-inner js-file-line">    )</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L10" class="blob-num js-line-number js-blob-rnum" data-line-number="10"></td>
          <td id="file-upload-filetosharepoint-ps1-LC10" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L11" class="blob-num js-line-number js-blob-rnum" data-line-number="11"></td>
          <td id="file-upload-filetosharepoint-ps1-LC11" class="blob-code blob-code-inner js-file-line"># Original script - 01-May-2013 - David Wise</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L12" class="blob-num js-line-number js-blob-rnum" data-line-number="12"></td>
          <td id="file-upload-filetosharepoint-ps1-LC12" class="blob-code blob-code-inner js-file-line"># GIST Url: <a href="https://gist.github.com/DavidWise/5495616" rel="nofollow">https://gist.github.com/DavidWise/5495616</a></td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L13" class="blob-num js-line-number js-blob-rnum" data-line-number="13"></td>
          <td id="file-upload-filetosharepoint-ps1-LC13" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L14" class="blob-num js-line-number js-blob-rnum" data-line-number="14"></td>
          <td id="file-upload-filetosharepoint-ps1-LC14" class="blob-code blob-code-inner js-file-line"># Note: for testing purposes, simply set $listUrl to a valid SharePoint Document Library and $file to the path of a local file to upload and then run the script</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L15" class="blob-num js-line-number js-blob-rnum" data-line-number="15"></td>
          <td id="file-upload-filetosharepoint-ps1-LC15" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L16" class="blob-num js-line-number js-blob-rnum" data-line-number="16"></td>
          <td id="file-upload-filetosharepoint-ps1-LC16" class="blob-code blob-code-inner js-file-line">
</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L17" class="blob-num js-line-number js-blob-rnum" data-line-number="17"></td>
          <td id="file-upload-filetosharepoint-ps1-LC17" class="blob-code blob-code-inner js-file-line">function SetFileTimes($pUploadedFile, [System.IO.FileInfo] $pLocalFile) {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L18" class="blob-num js-line-number js-blob-rnum" data-line-number="18"></td>
          <td id="file-upload-filetosharepoint-ps1-LC18" class="blob-code blob-code-inner js-file-line">    $item = $pUploadedFile.Item</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L19" class="blob-num js-line-number js-blob-rnum" data-line-number="19"></td>
          <td id="file-upload-filetosharepoint-ps1-LC19" class="blob-code blob-code-inner js-file-line">    if ($item -eq $null) { return }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L20" class="blob-num js-line-number js-blob-rnum" data-line-number="20"></td>
          <td id="file-upload-filetosharepoint-ps1-LC20" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L21" class="blob-num js-line-number js-blob-rnum" data-line-number="21"></td>
          <td id="file-upload-filetosharepoint-ps1-LC21" class="blob-code blob-code-inner js-file-line">    $item[&quot;Created&quot;] = $pLocalFile.CreationTime</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L22" class="blob-num js-line-number js-blob-rnum" data-line-number="22"></td>
          <td id="file-upload-filetosharepoint-ps1-LC22" class="blob-code blob-code-inner js-file-line">    $item[&quot;Modified&quot;] = $pLocalFile.LastWriteTime</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L23" class="blob-num js-line-number js-blob-rnum" data-line-number="23"></td>
          <td id="file-upload-filetosharepoint-ps1-LC23" class="blob-code blob-code-inner js-file-line">    $item.Update()</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L24" class="blob-num js-line-number js-blob-rnum" data-line-number="24"></td>
          <td id="file-upload-filetosharepoint-ps1-LC24" class="blob-code blob-code-inner js-file-line">}</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L25" class="blob-num js-line-number js-blob-rnum" data-line-number="25"></td>
          <td id="file-upload-filetosharepoint-ps1-LC25" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L26" class="blob-num js-line-number js-blob-rnum" data-line-number="26"></td>
          <td id="file-upload-filetosharepoint-ps1-LC26" class="blob-code blob-code-inner js-file-line"># basic required parameters</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L27" class="blob-num js-line-number js-blob-rnum" data-line-number="27"></td>
          <td id="file-upload-filetosharepoint-ps1-LC27" class="blob-code blob-code-inner js-file-line">if ($ListUrl -eq $null -or $file -eq $null) {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L28" class="blob-num js-line-number js-blob-rnum" data-line-number="28"></td>
          <td id="file-upload-filetosharepoint-ps1-LC28" class="blob-code blob-code-inner js-file-line">    write-output &quot;A ListUrl and a File must be specified&quot;</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L29" class="blob-num js-line-number js-blob-rnum" data-line-number="29"></td>
          <td id="file-upload-filetosharepoint-ps1-LC29" class="blob-code blob-code-inner js-file-line">    exit 4</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L30" class="blob-num js-line-number js-blob-rnum" data-line-number="30"></td>
          <td id="file-upload-filetosharepoint-ps1-LC30" class="blob-code blob-code-inner js-file-line">}</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L31" class="blob-num js-line-number js-blob-rnum" data-line-number="31"></td>
          <td id="file-upload-filetosharepoint-ps1-LC31" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L32" class="blob-num js-line-number js-blob-rnum" data-line-number="32"></td>
          <td id="file-upload-filetosharepoint-ps1-LC32" class="blob-code blob-code-inner js-file-line"># does the specified file exist?</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L33" class="blob-num js-line-number js-blob-rnum" data-line-number="33"></td>
          <td id="file-upload-filetosharepoint-ps1-LC33" class="blob-code blob-code-inner js-file-line">if ([System.IO.File]::Exists($file) -eq $false) {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L34" class="blob-num js-line-number js-blob-rnum" data-line-number="34"></td>
          <td id="file-upload-filetosharepoint-ps1-LC34" class="blob-code blob-code-inner js-file-line">    write-output &quot;The specified file &#39;$file&#39; does not exist&quot;</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L35" class="blob-num js-line-number js-blob-rnum" data-line-number="35"></td>
          <td id="file-upload-filetosharepoint-ps1-LC35" class="blob-code blob-code-inner js-file-line">    exit 5</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L36" class="blob-num js-line-number js-blob-rnum" data-line-number="36"></td>
          <td id="file-upload-filetosharepoint-ps1-LC36" class="blob-code blob-code-inner js-file-line">}</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L37" class="blob-num js-line-number js-blob-rnum" data-line-number="37"></td>
          <td id="file-upload-filetosharepoint-ps1-LC37" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L38" class="blob-num js-line-number js-blob-rnum" data-line-number="38"></td>
          <td id="file-upload-filetosharepoint-ps1-LC38" class="blob-code blob-code-inner js-file-line">$destUri = $null</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L39" class="blob-num js-line-number js-blob-rnum" data-line-number="39"></td>
          <td id="file-upload-filetosharepoint-ps1-LC39" class="blob-code blob-code-inner js-file-line">$localFile = get-item -LiteralPath $file</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L40" class="blob-num js-line-number js-blob-rnum" data-line-number="40"></td>
          <td id="file-upload-filetosharepoint-ps1-LC40" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L41" class="blob-num js-line-number js-blob-rnum" data-line-number="41"></td>
          <td id="file-upload-filetosharepoint-ps1-LC41" class="blob-code blob-code-inner js-file-line">$site = $null</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L42" class="blob-num js-line-number js-blob-rnum" data-line-number="42"></td>
          <td id="file-upload-filetosharepoint-ps1-LC42" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L43" class="blob-num js-line-number js-blob-rnum" data-line-number="43"></td>
          <td id="file-upload-filetosharepoint-ps1-LC43" class="blob-code blob-code-inner js-file-line">try {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L44" class="blob-num js-line-number js-blob-rnum" data-line-number="44"></td>
          <td id="file-upload-filetosharepoint-ps1-LC44" class="blob-code blob-code-inner js-file-line">    # can we open the SharePoint site from the URL?</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L45" class="blob-num js-line-number js-blob-rnum" data-line-number="45"></td>
          <td id="file-upload-filetosharepoint-ps1-LC45" class="blob-code blob-code-inner js-file-line">    $destUri = [System.Uri]($listUrl)</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L46" class="blob-num js-line-number js-blob-rnum" data-line-number="46"></td>
          <td id="file-upload-filetosharepoint-ps1-LC46" class="blob-code blob-code-inner js-file-line">    write-output &quot;Opening: $listUrl&quot;</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L47" class="blob-num js-line-number js-blob-rnum" data-line-number="47"></td>
          <td id="file-upload-filetosharepoint-ps1-LC47" class="blob-code blob-code-inner js-file-line">    $site =  [Microsoft.SharePoint.SPSite]($listUrl)</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L48" class="blob-num js-line-number js-blob-rnum" data-line-number="48"></td>
          <td id="file-upload-filetosharepoint-ps1-LC48" class="blob-code blob-code-inner js-file-line">} catch {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L49" class="blob-num js-line-number js-blob-rnum" data-line-number="49"></td>
          <td id="file-upload-filetosharepoint-ps1-LC49" class="blob-code blob-code-inner js-file-line">    $msg = $error[0].Exception.Message</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L50" class="blob-num js-line-number js-blob-rnum" data-line-number="50"></td>
          <td id="file-upload-filetosharepoint-ps1-LC50" class="blob-code blob-code-inner js-file-line">    write-output &quot;Unable to open site &#39;$ListUrl&#39; - $msg&quot;</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L51" class="blob-num js-line-number js-blob-rnum" data-line-number="51"></td>
          <td id="file-upload-filetosharepoint-ps1-LC51" class="blob-code blob-code-inner js-file-line">    exit 6</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L52" class="blob-num js-line-number js-blob-rnum" data-line-number="52"></td>
          <td id="file-upload-filetosharepoint-ps1-LC52" class="blob-code blob-code-inner js-file-line">}</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L53" class="blob-num js-line-number js-blob-rnum" data-line-number="53"></td>
          <td id="file-upload-filetosharepoint-ps1-LC53" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L54" class="blob-num js-line-number js-blob-rnum" data-line-number="54"></td>
          <td id="file-upload-filetosharepoint-ps1-LC54" class="blob-code blob-code-inner js-file-line">$queryParams = [System.Web.HttpUtility]::ParseQueryString($destUri.Query)</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L55" class="blob-num js-line-number js-blob-rnum" data-line-number="55"></td>
          <td id="file-upload-filetosharepoint-ps1-LC55" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L56" class="blob-num js-line-number js-blob-rnum" data-line-number="56"></td>
          <td id="file-upload-filetosharepoint-ps1-LC56" class="blob-code blob-code-inner js-file-line">$folderPath = $queryParams[&quot;RootFolder&quot;]</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L57" class="blob-num js-line-number js-blob-rnum" data-line-number="57"></td>
          <td id="file-upload-filetosharepoint-ps1-LC57" class="blob-code blob-code-inner js-file-line">if ($folderPath -eq $null) {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L58" class="blob-num js-line-number js-blob-rnum" data-line-number="58"></td>
          <td id="file-upload-filetosharepoint-ps1-LC58" class="blob-code blob-code-inner js-file-line">    $folderPath = $destUri.LocalPath</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L59" class="blob-num js-line-number js-blob-rnum" data-line-number="59"></td>
          <td id="file-upload-filetosharepoint-ps1-LC59" class="blob-code blob-code-inner js-file-line">}</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L60" class="blob-num js-line-number js-blob-rnum" data-line-number="60"></td>
          <td id="file-upload-filetosharepoint-ps1-LC60" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L61" class="blob-num js-line-number js-blob-rnum" data-line-number="61"></td>
          <td id="file-upload-filetosharepoint-ps1-LC61" class="blob-code blob-code-inner js-file-line">$web = $site.OpenWeb()</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L62" class="blob-num js-line-number js-blob-rnum" data-line-number="62"></td>
          <td id="file-upload-filetosharepoint-ps1-LC62" class="blob-code blob-code-inner js-file-line">$folder = $null</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L63" class="blob-num js-line-number js-blob-rnum" data-line-number="63"></td>
          <td id="file-upload-filetosharepoint-ps1-LC63" class="blob-code blob-code-inner js-file-line">$list = $null</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L64" class="blob-num js-line-number js-blob-rnum" data-line-number="64"></td>
          <td id="file-upload-filetosharepoint-ps1-LC64" class="blob-code blob-code-inner js-file-line">$file = $null</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L65" class="blob-num js-line-number js-blob-rnum" data-line-number="65"></td>
          <td id="file-upload-filetosharepoint-ps1-LC65" class="blob-code blob-code-inner js-file-line">$exitCode = 0</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L66" class="blob-num js-line-number js-blob-rnum" data-line-number="66"></td>
          <td id="file-upload-filetosharepoint-ps1-LC66" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L67" class="blob-num js-line-number js-blob-rnum" data-line-number="67"></td>
          <td id="file-upload-filetosharepoint-ps1-LC67" class="blob-code blob-code-inner js-file-line">try {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L68" class="blob-num js-line-number js-blob-rnum" data-line-number="68"></td>
          <td id="file-upload-filetosharepoint-ps1-LC68" class="blob-code blob-code-inner js-file-line">    $folder = $web.GetFolder($folderPath)</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L69" class="blob-num js-line-number js-blob-rnum" data-line-number="69"></td>
          <td id="file-upload-filetosharepoint-ps1-LC69" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L70" class="blob-num js-line-number js-blob-rnum" data-line-number="70"></td>
          <td id="file-upload-filetosharepoint-ps1-LC70" class="blob-code blob-code-inner js-file-line">    $list = $web.GetList($listUrl)</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L71" class="blob-num js-line-number js-blob-rnum" data-line-number="71"></td>
          <td id="file-upload-filetosharepoint-ps1-LC71" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L72" class="blob-num js-line-number js-blob-rnum" data-line-number="72"></td>
          <td id="file-upload-filetosharepoint-ps1-LC72" class="blob-code blob-code-inner js-file-line">    $bRequiresCheckIn = $false</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L73" class="blob-num js-line-number js-blob-rnum" data-line-number="73"></td>
          <td id="file-upload-filetosharepoint-ps1-LC73" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L74" class="blob-num js-line-number js-blob-rnum" data-line-number="74"></td>
          <td id="file-upload-filetosharepoint-ps1-LC74" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L75" class="blob-num js-line-number js-blob-rnum" data-line-number="75"></td>
          <td id="file-upload-filetosharepoint-ps1-LC75" class="blob-code blob-code-inner js-file-line">    if ($list -eq $null) { throw &quot;Unable to open list&quot; }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L76" class="blob-num js-line-number js-blob-rnum" data-line-number="76"></td>
          <td id="file-upload-filetosharepoint-ps1-LC76" class="blob-code blob-code-inner js-file-line">    if ($folder -eq $null -or $folder.Exists -eq $false) { throw &quot;Unable to open folder &#39;$folderPath&#39;&quot; }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L77" class="blob-num js-line-number js-blob-rnum" data-line-number="77"></td>
          <td id="file-upload-filetosharepoint-ps1-LC77" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L78" class="blob-num js-line-number js-blob-rnum" data-line-number="78"></td>
          <td id="file-upload-filetosharepoint-ps1-LC78" class="blob-code blob-code-inner js-file-line">    #if the library requires a check out, we must do that first</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L79" class="blob-num js-line-number js-blob-rnum" data-line-number="79"></td>
          <td id="file-upload-filetosharepoint-ps1-LC79" class="blob-code blob-code-inner js-file-line">    if ($list.ForceCheckout -eq $true) {    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L80" class="blob-num js-line-number js-blob-rnum" data-line-number="80"></td>
          <td id="file-upload-filetosharepoint-ps1-LC80" class="blob-code blob-code-inner js-file-line">        $folder.Files | %{</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L81" class="blob-num js-line-number js-blob-rnum" data-line-number="81"></td>
          <td id="file-upload-filetosharepoint-ps1-LC81" class="blob-code blob-code-inner js-file-line">            if ($_.Name -eq  $localFile.Name) { </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L82" class="blob-num js-line-number js-blob-rnum" data-line-number="82"></td>
          <td id="file-upload-filetosharepoint-ps1-LC82" class="blob-code blob-code-inner js-file-line">                #if we have a match, check it out</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L83" class="blob-num js-line-number js-blob-rnum" data-line-number="83"></td>
          <td id="file-upload-filetosharepoint-ps1-LC83" class="blob-code blob-code-inner js-file-line">                # ~~ in testing I found that under certain conditions, the document would exist after deletion but with a version of 0.1</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L84" class="blob-num js-line-number js-blob-rnum" data-line-number="84"></td>
          <td id="file-upload-filetosharepoint-ps1-LC84" class="blob-code blob-code-inner js-file-line">                # ~~ I&#39;m not sure why but turning off the Require CheckOut option and then running this code cleared it up</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L85" class="blob-num js-line-number js-blob-rnum" data-line-number="85"></td>
          <td id="file-upload-filetosharepoint-ps1-LC85" class="blob-code blob-code-inner js-file-line">                if ($_.CheckOutType -ne &quot;None&quot;) {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L86" class="blob-num js-line-number js-blob-rnum" data-line-number="86"></td>
          <td id="file-upload-filetosharepoint-ps1-LC86" class="blob-code blob-code-inner js-file-line">                    $_.UndoCheckOut()</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L87" class="blob-num js-line-number js-blob-rnum" data-line-number="87"></td>
          <td id="file-upload-filetosharepoint-ps1-LC87" class="blob-code blob-code-inner js-file-line">                }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L88" class="blob-num js-line-number js-blob-rnum" data-line-number="88"></td>
          <td id="file-upload-filetosharepoint-ps1-LC88" class="blob-code blob-code-inner js-file-line">                $_.CheckOut()</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L89" class="blob-num js-line-number js-blob-rnum" data-line-number="89"></td>
          <td id="file-upload-filetosharepoint-ps1-LC89" class="blob-code blob-code-inner js-file-line">                $bRequiresCheckIn = $true</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L90" class="blob-num js-line-number js-blob-rnum" data-line-number="90"></td>
          <td id="file-upload-filetosharepoint-ps1-LC90" class="blob-code blob-code-inner js-file-line">            }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L91" class="blob-num js-line-number js-blob-rnum" data-line-number="91"></td>
          <td id="file-upload-filetosharepoint-ps1-LC91" class="blob-code blob-code-inner js-file-line">        }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L92" class="blob-num js-line-number js-blob-rnum" data-line-number="92"></td>
          <td id="file-upload-filetosharepoint-ps1-LC92" class="blob-code blob-code-inner js-file-line">    }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L93" class="blob-num js-line-number js-blob-rnum" data-line-number="93"></td>
          <td id="file-upload-filetosharepoint-ps1-LC93" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L94" class="blob-num js-line-number js-blob-rnum" data-line-number="94"></td>
          <td id="file-upload-filetosharepoint-ps1-LC94" class="blob-code blob-code-inner js-file-line">    $stream = $localFile.OpenRead()</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L95" class="blob-num js-line-number js-blob-rnum" data-line-number="95"></td>
          <td id="file-upload-filetosharepoint-ps1-LC95" class="blob-code blob-code-inner js-file-line">    $newFile = $folder.Files.Add($folder.Url + &quot;/&quot; + $localFile.Name, $stream, $true, $checkInComment, $false)</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L96" class="blob-num js-line-number js-blob-rnum" data-line-number="96"></td>
          <td id="file-upload-filetosharepoint-ps1-LC96" class="blob-code blob-code-inner js-file-line">    $stream.Close()</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L97" class="blob-num js-line-number js-blob-rnum" data-line-number="97"></td>
          <td id="file-upload-filetosharepoint-ps1-LC97" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L98" class="blob-num js-line-number js-blob-rnum" data-line-number="98"></td>
          <td id="file-upload-filetosharepoint-ps1-LC98" class="blob-code blob-code-inner js-file-line">    if ($useFileTimes) { SetFileTimes $newFile $localFile }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L99" class="blob-num js-line-number js-blob-rnum" data-line-number="99"></td>
          <td id="file-upload-filetosharepoint-ps1-LC99" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L100" class="blob-num js-line-number js-blob-rnum" data-line-number="100"></td>
          <td id="file-upload-filetosharepoint-ps1-LC100" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L101" class="blob-num js-line-number js-blob-rnum" data-line-number="101"></td>
          <td id="file-upload-filetosharepoint-ps1-LC101" class="blob-code blob-code-inner js-file-line">    if ($bRequiresCheckIn -eq $true -or $publishMajorVersion -eq $true) {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L102" class="blob-num js-line-number js-blob-rnum" data-line-number="102"></td>
          <td id="file-upload-filetosharepoint-ps1-LC102" class="blob-code blob-code-inner js-file-line">        $revType = 0 # minor rev</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L103" class="blob-num js-line-number js-blob-rnum" data-line-number="103"></td>
          <td id="file-upload-filetosharepoint-ps1-LC103" class="blob-code blob-code-inner js-file-line">        if ($list.EnableVersioning -eq $true -and $publishMajorVersion -eq $true) { $revType = 1 }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L104" class="blob-num js-line-number js-blob-rnum" data-line-number="104"></td>
          <td id="file-upload-filetosharepoint-ps1-LC104" class="blob-code blob-code-inner js-file-line">        if ($list.EnableVersioning -eq $false) { $revType = 2 }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L105" class="blob-num js-line-number js-blob-rnum" data-line-number="105"></td>
          <td id="file-upload-filetosharepoint-ps1-LC105" class="blob-code blob-code-inner js-file-line">        if ($newFile.CheckOutType -eq &quot;None&quot;) { $newFile.CheckOut() }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L106" class="blob-num js-line-number js-blob-rnum" data-line-number="106"></td>
          <td id="file-upload-filetosharepoint-ps1-LC106" class="blob-code blob-code-inner js-file-line">        $newFile.CheckIn($checkInComment, $revType)</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L107" class="blob-num js-line-number js-blob-rnum" data-line-number="107"></td>
          <td id="file-upload-filetosharepoint-ps1-LC107" class="blob-code blob-code-inner js-file-line">    }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L108" class="blob-num js-line-number js-blob-rnum" data-line-number="108"></td>
          <td id="file-upload-filetosharepoint-ps1-LC108" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L109" class="blob-num js-line-number js-blob-rnum" data-line-number="109"></td>
          <td id="file-upload-filetosharepoint-ps1-LC109" class="blob-code blob-code-inner js-file-line">    if ($list.EnableModeration -eq $true -and $approve -eq $true) {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L110" class="blob-num js-line-number js-blob-rnum" data-line-number="110"></td>
          <td id="file-upload-filetosharepoint-ps1-LC110" class="blob-code blob-code-inner js-file-line">        $newFile.Approve($approvalComment)</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L111" class="blob-num js-line-number js-blob-rnum" data-line-number="111"></td>
          <td id="file-upload-filetosharepoint-ps1-LC111" class="blob-code blob-code-inner js-file-line">    }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L112" class="blob-num js-line-number js-blob-rnum" data-line-number="112"></td>
          <td id="file-upload-filetosharepoint-ps1-LC112" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L113" class="blob-num js-line-number js-blob-rnum" data-line-number="113"></td>
          <td id="file-upload-filetosharepoint-ps1-LC113" class="blob-code blob-code-inner js-file-line">    Write-output &quot;File Uploaded successfully&quot;</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L114" class="blob-num js-line-number js-blob-rnum" data-line-number="114"></td>
          <td id="file-upload-filetosharepoint-ps1-LC114" class="blob-code blob-code-inner js-file-line">    </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L115" class="blob-num js-line-number js-blob-rnum" data-line-number="115"></td>
          <td id="file-upload-filetosharepoint-ps1-LC115" class="blob-code blob-code-inner js-file-line">} catch {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L116" class="blob-num js-line-number js-blob-rnum" data-line-number="116"></td>
          <td id="file-upload-filetosharepoint-ps1-LC116" class="blob-code blob-code-inner js-file-line">    $msg = $error[0].Exception.Message</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L117" class="blob-num js-line-number js-blob-rnum" data-line-number="117"></td>
          <td id="file-upload-filetosharepoint-ps1-LC117" class="blob-code blob-code-inner js-file-line">    write-output &quot;Unable to open list Url &#39;$ListUrl&#39; - $msg&quot;</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L118" class="blob-num js-line-number js-blob-rnum" data-line-number="118"></td>
          <td id="file-upload-filetosharepoint-ps1-LC118" class="blob-code blob-code-inner js-file-line">    $exitCode=9</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L119" class="blob-num js-line-number js-blob-rnum" data-line-number="119"></td>
          <td id="file-upload-filetosharepoint-ps1-LC119" class="blob-code blob-code-inner js-file-line">}</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L120" class="blob-num js-line-number js-blob-rnum" data-line-number="120"></td>
          <td id="file-upload-filetosharepoint-ps1-LC120" class="blob-code blob-code-inner js-file-line">finally {</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L121" class="blob-num js-line-number js-blob-rnum" data-line-number="121"></td>
          <td id="file-upload-filetosharepoint-ps1-LC121" class="blob-code blob-code-inner js-file-line">    if ($web -ne $null) { $web.Dispose() }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L122" class="blob-num js-line-number js-blob-rnum" data-line-number="122"></td>
          <td id="file-upload-filetosharepoint-ps1-LC122" class="blob-code blob-code-inner js-file-line">    if ($site -ne $null) { $site.Dispose() }</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L123" class="blob-num js-line-number js-blob-rnum" data-line-number="123"></td>
          <td id="file-upload-filetosharepoint-ps1-LC123" class="blob-code blob-code-inner js-file-line">    $web = $null</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L124" class="blob-num js-line-number js-blob-rnum" data-line-number="124"></td>
          <td id="file-upload-filetosharepoint-ps1-LC124" class="blob-code blob-code-inner js-file-line">    $site = $null</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L125" class="blob-num js-line-number js-blob-rnum" data-line-number="125"></td>
          <td id="file-upload-filetosharepoint-ps1-LC125" class="blob-code blob-code-inner js-file-line">}</td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L126" class="blob-num js-line-number js-blob-rnum" data-line-number="126"></td>
          <td id="file-upload-filetosharepoint-ps1-LC126" class="blob-code blob-code-inner js-file-line"> </td>
        </tr>
        <tr>
          <td id="file-upload-filetosharepoint-ps1-L127" class="blob-num js-line-number js-blob-rnum" data-line-number="127"></td>
          <td id="file-upload-filetosharepoint-ps1-LC127" class="blob-code blob-code-inner js-file-line">exit $exitCode</td>
        </tr>
  </table>
</div>


    </div>

  </div>

</div>

      </div>
      <div class="gist-meta">
        <a href="https://gist.github.com/DavidWise/5495616/raw/a76e005e526657b44ab8e4ebaf9bb846ff65650c/Upload-FileToSharePoint.ps1" style="float:right" class="Link--inTextBlock">view raw</a>
        <a href="https://gist.github.com/DavidWise/5495616#file-upload-filetosharepoint-ps1" class="Link--inTextBlock">
          Upload-FileToSharePoint.ps1
        </a>
        hosted with &#10084; by <a class="Link--inTextBlock" href="https://github.com">GitHub</a>
      </div>
    </div>
</div>

]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/05/02/upload-files-to-sharepoint-using-powershell/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">523</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>A Bespoken Post</title>
		<link>https://blog.davidjwise.com/2013/02/25/a-bespoken-post/</link>
					<comments>https://blog.davidjwise.com/2013/02/25/a-bespoken-post/#respond</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Tue, 26 Feb 2013 01:12:16 +0000</pubDate>
				<category><![CDATA[Buzzwords]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=477</guid>

					<description><![CDATA[In my perusal of various IT and general news, I&#8217;ve noticed another word popping up all over the place : bespoke.  Apparently the simple word &#8220;custom&#8221;  is too pedestrian for some so they reach for this one from the 1600s instead to make themselves seem erudite whilst (and at the same time) obfuscating their true &#8230; <a href="https://blog.davidjwise.com/2013/02/25/a-bespoken-post/" class="more-link">Continue reading <span class="screen-reader-text">A Bespoken Post</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>In my perusal of various IT and general news, I&#8217;ve noticed another word popping up all over the place : <a href="http://www.merriam-webster.com/dictionary/bespoke">bespoke</a>.  Apparently the simple word &#8220;custom&#8221;  is too pedestrian for some so they reach for this one from the 1600s instead to make themselves seem erudite whilst (and at the same time) obfuscating their true meaning.</p>
<p>A long, long time ago, I was told that the purpose of communication is to convey your message to others in a form that they can easily and accurately understand.  However, some people think that if they deliberately say things in a way that confuses others that it makes them appear more intelligent.  This is from the same school of thought that says you can become taller by cutting the legs off of everyone else.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/02/25/a-bespoken-post/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">477</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>A List of All Changes in the February 2013 Cumulative Update</title>
		<link>https://blog.davidjwise.com/2013/02/19/a-list-of-all-changes-in-the-february-2013-cumulative-update/</link>
					<comments>https://blog.davidjwise.com/2013/02/19/a-list-of-all-changes-in-the-february-2013-cumulative-update/#comments</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Wed, 20 Feb 2013 00:58:15 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Cumulative Update]]></category>
		<category><![CDATA[patch]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=472</guid>

					<description><![CDATA[This article continues my series of attempting to put all of the various changes in a Cumulative Update into a single place.  This post only covers the February 2013 Cumulative Update for SharePoint 2010.  The details regarding the specific CU changes for SharePoint 2007 and for SharePoint 2013 can be found on the Microsoft site &#8230; <a href="https://blog.davidjwise.com/2013/02/19/a-list-of-all-changes-in-the-february-2013-cumulative-update/" class="more-link">Continue reading <span class="screen-reader-text">A List of All Changes in the February 2013 Cumulative Update</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>This article continues my series of attempting to put all of the various changes in a Cumulative Update into a single place.  This post only covers the February 2013 Cumulative Update for SharePoint 2010.  The details regarding the specific CU <span id="more-472"></span>changes for <a href="http://support.microsoft.com/kb/2800778">SharePoint 2007</a> and for <a href="http://support.microsoft.com/kb/2802843">SharePoint 2013</a> can be found on the Microsoft site with the usual obfuscation.</p>
<h1>SharePoint 2010 Foundation</h1>
<p><a href="http://support.microsoft.com/kb/2760774">2760774</a> (Wss-x-none.msp)</p>
<ul>
<li>Consider the following scenario:
<ul>
<li>You try to open a document from a document library in SharePoint Foundation 2010.</li>
<li>SharePoint Foundation 2010 cannot connect to the back-end SQL server.</li>
<li>Microsoft Forefront tries to scan the document.</li>
</ul>
</li>
</ul>
<p style="padding-left:30px;">In this scenario, the W3wp.exe process stops responding. Therefore, the following scan requests are in a pending state.</p>
<ul>
<li>When you delete a list item from a project task list in Project Tasks view, the list item does not appear in the Recycle Bin. Instead, the list item is deleted permanently.</li>
<li>Consider the following scenario:
<ul>
<li>You create a calendar list in SharePoint Foundation 2010.</li>
<li>You add an all-day event to the calendar list.</li>
<li>You create a Gantt view for the calendar list.</li>
<li>You open the all-day event in the Gantt view.</li>
</ul>
</li>
</ul>
<p style="padding-left:30px;">In this scenario, the start and end time of the all-day event is displayed incorrectly.</p>
<ul>
<li>Assume that you enable the inline editing feature for a custom list that contains some list items. When you try to sort the list items in descending order, the list items are unexpectedly sorted in ascending order.</li>
<li>Consider the following scenario:
<ul>
<li>You add a heading to the <b>Navigation</b> pane of a team site, and the heading contains links.</li>
<li>You create a custom list on the team site in Datasheet view.</li>
<li>You click the custom list on the <b>Quick Launch</b> bar.</li>
<li>You rest the mouse pointer over the heading that you added.</li>
</ul>
</li>
</ul>
<p style="padding-left:30px;">In this scenario, the flyout menu for the heading is displayed behind the Datasheet view. Therefore, you cannot access the menu.</p>
<ul>
<li>Assume that you enable forms-based authentication in SharePoint Foundation 2010. When you use a mobile device to access a SharePoint site, you receive the following error message:</li>
</ul>
<blockquote><p>An error occurred during the compilation of the requested file, or one of its dependencies.</p></blockquote>
<h1>SharePoint 2010 Server</h1>
<p><a href="http://support.microsoft.com/kb/2767793">2767793</a> (SharePoint server-package)</p>
<p>Includes all fixes from the Foundation CU <a href="http://support.microsoft.com/kb/2760774">2760774</a> as well as all</p>
<ul>
<li>When you remove a hyperlink from a Hyperlink with formatting constraints for publishing column in SharePoint Server 2010, new hyperlinks cannot be added to the column.</li>
<li>Assume that you have a document library named “Transfer” that has been recently accessed in SharePoint Server 2010. You run the Merge-SPLogFile cmdlet to return Unified Logging Service (ULS) log entries by using a correlation ID filter. In this situation, the cmdlet returns no results and you receive the following error message:</li>
</ul>
<blockquote><p>WARNING: Cmdlet did not return any records in the log file. Check your time range or filters.</p></blockquote>
<p><a href="http://support.microsoft.com/kb/2767795">2767795</a> (Coreserver-x-none.msp)</p>
<ul>
<li>Assume that you rate a document in a SharePoint Server 2010 document library. When you run an incremental crawl on the site collection that contains the document library, the new rating for the document is not displayed.</li>
<li>Assume that you click <b>No</b> in the Dialogs section on the Library Settings page in a library. Then, you add a document set to the library. After you upload multiple documents to the document set, you are unexpectedly redirected to the root site of the site collection that contains the library.</li>
<li>Consider the following scenario:
<ul>
<li>You configure the User Profile Service Application on a farm (farm A).</li>
<li>You use the User Profile Service Application to configure a My Site site to point to a web application in a different farm (farm B).</li>
<li>You update the <b>Manager</b> field value on the My Site site, and then you save the change.</li>
<li>In this scenario, you receive the following error message:</li>
</ul>
</li>
</ul>
<blockquote><p>An error occurred trying to save your profile.</p></blockquote>
<p><b>Note</b> Although you receive the error message, the change is saved. When you try to save the change again, you do not receive an error message.</p>
<ul>
<li>Assume that you search for a user profile by using the &#8220;people search&#8221; function on a SharePoint team site. If the user that you search for is not logged in to the My Site site before you search for the user profile, the profile picture of the user profile is not displayed in the search results.</li>
</ul>
<p><a href="http://support.microsoft.com/kb/2553166">2553166</a> (Wdsrv-x-none.msp)</p>
<p>Note: This KB is referenced in the several articles but does not appear to have been published yet.  I’ll update this post whenever that page becomes available.</p>
<p><a href="http://support.microsoft.com/kb/2589344">2589344</a> (Ppsmawfe-x-none.msp)</p>
<ul>
<li>After you apply hotfix 2687353 in Microsoft SharePoint Server 2010, the New Dimension Filter lists only one member of a SharePoint list data source in PerformancePoint 2010 Dashboard Designer.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/02/19/a-list-of-all-changes-in-the-february-2013-cumulative-update/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">472</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>Another Option for Missing “Sign in as Different User” link in SharePoint 2013</title>
		<link>https://blog.davidjwise.com/2013/02/18/missing-sign-in-as-different-user-link-s2013/</link>
					<comments>https://blog.davidjwise.com/2013/02/18/missing-sign-in-as-different-user-link-s2013/#comments</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Tue, 19 Feb 2013 00:45:53 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[workaround]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=465</guid>

					<description><![CDATA[In SharePoint 2010, there was a wonderful option called &#8220;Sign in as Different User&#8221; that would allow you to quickly, easily and painlessly switch user accounts in the browser without losing your place on a site. This worked wonderfully for developers and for Admins where they have multiple IDs. However, it confused the average user &#8230; <a href="https://blog.davidjwise.com/2013/02/18/missing-sign-in-as-different-user-link-s2013/" class="more-link">Continue reading <span class="screen-reader-text">Another Option for Missing &#8220;Sign in as Different User&#8221; link in SharePoint 2013</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>In SharePoint 2010, there was a wonderful option called &#8220;Sign in as Different User&#8221; that would allow you to quickly, easily and painlessly switch user accounts in the browser without losing your place on a site.  This worked wonderfully for developers and for Admins where they have multiple IDs.  However, it confused the average user and <span id="more-465"></span>generated support calls because it would break other Office functionality so Microsoft removed it from the interface.  They did not remove the functionality from SharePoint though it is entirely possible (read: likely) that they will do so in the next version.</p>
<p>Microsoft has documented a few <a href="http://support.microsoft.com/kb/2752600">relatively simple ways around this</a> but I was looking for something a little faster and that was as easy as it was in SharePoint 2010.  To that end, I took the second option in their recommendation and tweaked it a little bit.</p>
<p>This solution is intended for developers and administrators only as they generally have the technical depth to understand the ramifications of processes running under different IDs.  If you need a solution to this for your whole user base, then you will need to look at the third option in Microsoft&#8217;s note above.</p>
<p>Ok, with that out of the way, the &#8220;fix&#8221; was merely a little extra javascript in a bookmark.  In my case, I added a bookmark to my browser bar, edited it and replaced the URL with the script below.  Naturally the steps for this vary with the browser but most at least start the process with a right-click on any web page.</p>
<pre class="brush: jscript; light: true; title: ; notranslate">
javascript:void(window.location.href='/_layouts/closeConnection.aspx?loginasanotheruser=true&amp;Source=' + encodeURIComponent(window.location.href));
</pre>
<p>This walks through the same logout/login mechanism that was in SharePoint 2010 and, best of all, bounces you right back to the page you were on but now as the new user identity.  It is even one click faster than the same process in 2010 <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/02/18/missing-sign-in-as-different-user-link-s2013/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">465</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
		<item>
		<title>Creating “Dynamic” XSL Variables</title>
		<link>https://blog.davidjwise.com/2013/01/31/dynamic-xsl-variables/</link>
					<comments>https://blog.davidjwise.com/2013/01/31/dynamic-xsl-variables/#respond</comments>
		
		<dc:creator><![CDATA[David Wise]]></dc:creator>
		<pubDate>Thu, 31 Jan 2013 23:05:56 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Tips]]></category>
		<guid isPermaLink="false">http://blog.davidjwise.com/?p=458</guid>

					<description><![CDATA[One of the really ugly things about working with Xsl is that it doesn&#8217;t support actual variables. There is a &#8216;variable&#8217; element but it isn&#8217;t actually a variable; it is a constant as the value cannot be changed once it has been set. This leads to all sorts of horrible solutions, like duplicating Xsl for &#8230; <a href="https://blog.davidjwise.com/2013/01/31/dynamic-xsl-variables/" class="more-link">Continue reading <span class="screen-reader-text">Creating &#8220;Dynamic&#8221; XSL Variables</span> <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[<p>One of the really ugly things about working with Xsl is that it doesn&#8217;t support actual variables.  There is a &#8216;variable&#8217; element but it isn&#8217;t actually a variable; it is a constant as the value cannot be changed once it has been set.  This leads to all sorts of horrible solutions, like duplicating Xsl for the various possible values/conditions or even turning a block of Xsl into a template and then passing parameters to it every time that value is needed.  The latter works and is supported but is frequently overkill.</p>
<p>However, there is another way<span id="more-458"></span> to do this.  Simply move the conditional logic needed to set the variable&#8217;s value to within the variable declaration itself. </p>
<pre class="brush: xml; light: true; title: ; notranslate">
  &lt;xsl:variable name=&quot;myVariable&quot;&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test=&quot;someVariable = aValue&quot;&gt;
        &lt;xsl:value-of select=&quot;oneValue&quot;/&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:value-of select=&quot;anotherValue&quot;/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
  &lt;/xsl:variable&gt;
</pre>
<p>This is still not as clean as I would like but allows for the variable to be set conditionally in one place so that it can be used easily elsewhere in the Xsl without having to worry about passing template parameters and so forth.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.davidjwise.com/2013/01/31/dynamic-xsl-variables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">458</post-id>
		<media:content medium="image" url="https://0.gravatar.com/avatar/049ce34aca248efcf5c96e53529fbbfa63d1b513afa1f53d0cabbb65ee1235cd?s=96&amp;d=identicon&amp;r=G">
			<media:title type="html">dwise5</media:title>
		</media:content>
	</item>
	</channel>
</rss>