The leaders of some the biggest technology firms in the U.S. have expressed dismay over President Donald Trump's executive order curtailing immigration from seven Muslim-majority countries, even as some of those companies are in hot water for previously supporting the administration.

The immigration issue is especially problematic for Silicon Valley, the southern San Francisco Bay area where many startup and global technology companies are based, as the industry increasingly relies on foreign engineers and other technical experts for a sizable percentage of its workforce.

Temporary worker permits for high-skilled workers are known as H-1Bs, and leaks of draft executive orders, still unverified, suggest Trump might revamp the program, which has allowed Silicon Valley companies to bring foreigners with technical skills to the U.S. for three to six years. Currently the system is lottery based, and capped at 85,000 workers a year.

While the tech industry insists the H1-B program is vital, it has drawn fire for allegedly disadvantaging American programmers and engineers, especially given that the visas are widely used by outsourcing firms. Trump's attorney general nominee, Senator Jeff Sessions, is a longtime critic of the program.

'Trump's actions are hurting Netflix employees around the world, and are so unAmerican it pains us all.' - Reed Hastings, Netflix CEO

"I share your concerns" about Trump's immigration order, Apple CEO Tim Cook wrote in a memo to employees that was obtained by The Associated Press. "It is not a policy we support.

"We have reached out to the White House to explain the negative effect on our coworkers and our company," he added.

Cook didn't say how many Apple employees are directly affected by the order, but said the company's human resources, legal and security teams are in contact to support them.

"Apple would not exist without immigration, let alone thrive and innovate the way we do," Cook wrote, an apparent reference not only to the company's foreign-born employees, but to Apple co-founder Steve Jobs, the son of a Syrian immigrant.

Netflix chief executive Reed Hastings was forcefully blunt.

'Time to link arms'

"Trump's actions are hurting Netflix employees around the world, and are so unAmerican it pains us all," he wrote on Facebook . "Worse, these actions will make America less safe (through hatred and loss of allies) rather than more safe.

"It is time to link arms together to protect American values of freedom and opportunity," he continued. 

Facebook founder Mark Zuckerberg criticized the order in similar, though more carefully couched, terms on Friday. "We are assessing the impact on our workforce and determining how best to protect our people and their families from any adverse effects," a spokesperson for Facebook Canada said in a statement to CBC News.

Ride-hailing service Uber is at the centre of the storm. CEO Travis Kalanick has had a cordial relationship with the new U.S. president, but said in a Facebook post that the 90-day ban could hurt "thousands" of Uber drivers, and that he plans to raise the issue with the president.

Kalanick defended his participation on Trump's panel in his Saturday Facebook post, saying he joined out of the "belief that by speaking up and engaging we can make a difference."

On Sunday, Kalanick said he would email Uber drivers to let them know he would "urge the government to reinstate the right of U.S. residents to travel — whatever their country of origin — immediately."

Uber also was criticized for charging less than it could at John F. Kennedy airport in New York City, as taxi drivers had halted service for an hour on Saturday to protest the ban. The move was perceived by some on social media as an effort to profit off the protests as more passengers would need to seek alternatives to cabs. But the company said on Twitter that it had not "meant to break the strike."

ACLU donations flood in

Ride-sharing service Lyft's co-founders, John Zimmer and Logan Green, pledged on the company's blog to donate more than $1 million to the American Civil Liberties Union. Yet Lyft also counts Peter Thiel as an investor, and Thiel has unquestionably been Trump's biggest supporter in the Silicon Valley.

Technology investor Chris Sacca, an early backer of Uber and Instagram, said on Twitter that he would match ACLU donations up to $75,000 after the organization sued over the ban — and then decided to donate another $75,000, for a total of $150,000. EBay founder Pierre Omidyar, the child of Iranians, complained that the order was "simple bigotry ."

Tesla Motors and SpaceX founder Elon Musk, who recently appeared to be cultivating a relationship with Trump, tweeted that "many people negatively affected by this policy are strong supporters of the U.S." who don't "deserve to be rejected." Musk is an immigrant from South Africa.

Google told its employees from those countries under the Trump executive order to cancel any travel plans outside the U.S. and consult with the company's human resources department if they're not currently in the U.S., according to a company-wide note described to The Associated Press. That memo was first reported by Bloomberg and the Wall Street Journal.

Google CEO Sundar Pichai told employees in the note that at least 187 workers could be affected by Trump's order. It is not clear how many of those workers are currently travelling outside the U.S.

"We've always made our views on immigration known publicly and will continue to do so," Pichai said in the memo.

TRUMP TOWER

Peter Thiel, right, made billions as an early investor in PayPal and is currently on the board of Facebook. He has been a staunch ally of Donald Trump since even before he was elected as U.S. president. (Albin Lohr-Jones/Bloomberg)

Company representatives declined to discuss the memo or to answer questions about the affected employees. In an official statement, Google said: "We're concerned about the impact of this order and any proposals that could impose restrictions on Googlers and their families, or that could create barriers to bringing great talent to the U.S."

The company said Monday it had set up a fund with $2 million that can be matched by the same amount of employee donations, to fund immigrant-focused groups including the ACLU.

Microsoft also said it is providing legal advice and assistance to its employees from the banned countries, noting they are all working in the U.S. lawfully.

Opposition to the immigration plan came from outside the technology world, too, as executives at Ford said in a statement to employees that the company does not support what it called a new U.S. travel ban.

With files from The Associated Press